Posts Tagged ADF

Set all WebLogic log levels to “Inherit” via WLST

Logging is a very useful feature of WebLogic.

Unfortunately the log levels, which are set after a clean install of WebLogic or some of the Fusion Middleware product creates a lot of noise and therefore it costs I/O performance.

Additional after analyzing an issue with logging often resetting the log level is forgotten.

Here you get a script to reset the log levels at regular intervals or after a trace session.

#!/usr/bin/python
execfile('get_environment.py')
connect(wlUser, wlPassword, wlAdminUrl)
edit()
loggers = listLoggers(target=managedServer, runtime=0)
for key, value in loggers.items():
  if key <> "" and key <> "ADF_PERFORMANCE_MONITOR_DATABASE" and value <> "":
    print "set " + key + " from " + value + " to <Inherited>"
    setLogLevel(target=adfManagedServer, runtime=0, logger=key, level="")
loggers = listLoggers(target=adfManagedServer, runtime=0)
exit()

In line 2 a script is called to initialize your environment variables wlUser, wlPassword, wlAdminUrl and managedServer.
In line 5 you get the list of loggers.
In line 6..9 you iterate over this list.
In line 7 you can add your own restrictions. Here are already filtered all inherited loggers and one special tool logger for performance monitoring of ADF applications.
In line 10 the loggers are shown again for the result, you can remove this.

Now call this script via

$ORACLE_HOME/oracle_common/common/bin/wlst.sh config_loglevel.py

In the output you see similar output:

------------------------------------------------------------------------+-----------------
Logger                                                                  | Level
------------------------------------------------------------------------+-----------------
...
oracle.ods.virtualization.accesslog                                     | ERROR:1
...
set oracle.ods.virtualization.accesslog from ERROR:1 to <Inherited>

------------------------------------------------------------------------+-----------------
Logger                                                                  | Level
------------------------------------------------------------------------+-----------------
...
oracle.ods.virtualization.accesslog                                     | <Inherited>
...

This version of the script change only the persistent logger levels (runtime=0), because we don’t want influence running trace sessions. But as our servers are dayly started, all runtime log levels are resetted at this point to the persistent one’s.

That’s it.

References:

  • Log Configuration Commands
  • , , , , ,

    Leave a comment

    #Javaland 2016 conference day 2

     

    This was my second day:

    Michael Tamm (optivo GmbH): Feature Toggles on Steroids

    Very good summary off all topic’s covering feature toggles. Wish I had this summary 2 years before, were we have evaluated this. Unfortunately furthermore no solutions for declarative frameworks like Oracle ADF with it’s wizards and xml configurations, which later generated code. Ironic answer to my question: “Don’t use frameworks – use Java”

    Alexander Casall (Saxonia Systems AG): User Experience for techies

    Now comes someting completely different. As least I had expected. No techniques etc.. There are really german standards “Ergonomics of human-system interaction” in ISO 9241 – 110 (Dialogue principles) and ISO 9241 – 210 (Ergonomics of human-system interaction). I have to read this, if it really would help in development, or the presenter interprets this on its own. Nice and surprising presentation.

    Adam Gowdiak (Security Explorations): Java (in)security (Keynote)

    The presenter is really angry about Oracle and co. and the security in Java. Nevertheless it seems he has specialized only on this topic and earn this money on this. So I doesn’t know, if somebody or another product is better. What about security in OpenJDK? And what are now my alternatives? A little depressing keynote.

    Lars Röwekamp (open knowledge GmbH): Courage to professionalism

    I don’t know, what I had expected here, but this was a nice surprise too. The talk was about to find a common language between customer, analyst, developer and other roles. The patterns “Rich Entities” and “Value Objects” helps to find a way out of the helper, util and manager class hell and seems to improve the readability of the code for all stakeholders. But how will this fit in declarative Frameworks like Oracle ADF and it’s generated classes? Have to think about it. Very good speaker!

    Wolfgang Weigend (Oracle Deutschland): Build and Monitor Cloud PaaS with JVM’s Nashorn JavaScripts

    Unfortunately the worst presentation comes from Oracle itself. To be fair: this presentation should be held by Bruno Borges, which was prevented to come to Javaland. Tip: Never hold a presentation, which is created by another person, if you don’t know, what he know about the subject. But I’m not sure if I had understood more, if Bruno had held the presentation. I didn’t find a red thread in the slides. And I must add, I didn’t really find an alternative presentation in this time slot.

    Alexander Heusingfeld, Tammo van Lessen (innoQ Deutschland GmbH): When Microservices Meet Real-World Projects: Lessons Learned

    Interesting presentation but the topic was missed. This had little to do with Microservice, more what a consultant or any person has to learn on his way from Junior to Senior: communicate, communicate, communicate. Especially when you want to change something.

    Stephan Kaps (Bundesversicherungsamt): Flyway vs. LiquiBase – Battle of the database migration tools

    I wanted to do this comparison several times before, but had never enough time. Now I’m relative sure that I will start with Liquibase in my next private project before I develop the application. This was the subjective winner of the battle too. I’m overwhelmed by the mass of features of both tools. Very good summary!

    Architecture Kata

    This was a nice workshop to plan the application and technical architecture of a given small set of requirements. Result for me: the many participants from a lot of other companies comes to very similar architecture depending on the assumption they made. In real life you have to communicate again and again with your stakeholders to get answered all of the questions and get quick feedback from them. I have urgently to refresh my knowledge of tools for UML diagramming and graphical presentations. And for structured proceeding maybe I should look for TOGAF training?

    Conclusion

    This was inspiring conference, which gives me a lot of fresh ideas and reminders for some spilled goals for my private and company projects. I think we’ll see us next year!

    That’s it!

    , , , , , , , , , , , , , , , ,

    Leave a comment

    #Javaland 2016 conference day 1

    This year I have decided to give the Javaland conference a try. I’m not a java professional, but in the program was listed a lot of interesting testing presentations, so my company booked for me.

    The location in Phantasierend Brühl near cologne was very fine. Unfortunately the conference rooms had not enough space this year so for some presentation you have to go to 2 rooms outside of the parc. Additionally it is not understandable, why there is not wlan for such a conference.

    This was my first day:

    Jeremias Rößler (ReTest): Behavioral Diff as new test paradigm

    Why I don’t record a test with all information of my page objects, eliminate all variable parts until it is stable and reproducible and define this a my basic truth. If a code change break this test I check the problems, if these were expected or not. Good idea but – how many data created this and how long does it take to compare all this with previous successful run. I hope this new startup will give us effective tools for this paradigm.

    Simon Maple (ZeroTurnaround): Is Your Profiler Speaking the Same Language as You?

    When I can trust the Profiler, what are the basics of it and how can I ensure that the right data are available for it. Which traps exist, when instrumenting for tracing and logging. Nice insights, but I’m sure I have to reread the presentation to fully understand.

    Exhibition Hall after lunch

    Played around with a Jenkins docker instance and the new Pipeline Plugin (formerly named Workflow Plugin) at the Cloudbees booth. I had a nice short talk with Bernhard Cygan about some other Jenkins topics.

    Tobias Kraft, Ralf Müller (exensio GmbH): Spock and Geb: Clear and comprehensible tests

    This is an interesting combination of frameworks for human readable behavior tests. I’m not sure if it is really enterprise ready (do you use version 0.x?). Will this work with Oracle ADF development too? Have to check this as next opportunity.

    Sven Ruppert (Macros Reply): Practical mutation testing

    This seems to be the long searched key to find the right tests on the corner cases of our applications. I have mandatory to prove the mentioned PIT framework Very charismatic and tough presenter.

    Roel Spilker (TOPdesk), Reinier Zwitserloot (medipc.nl): Lombok: The Boilerplate Buster. It’s a Kind of Magic!

    Is this the way to hide generated and framework required code, like standard getters and setters, from the really interesting code, which implements my requirements? It is implemented as a java compiler plugin. Have to check immediately, if this will work with Oracle JDeveloper too. In Eclipse the structure shows the code of generated class, which contains the generated boilerplates via the lombok framework annotations. And what changes are required to fulfill now my static code analysis rules which work on the source code. Additional this was a very entertaining presentation.

    Bert Jan Schrijver (JPoint): Continuous Performance: Automated Load Testing with Gatling

    As our PoC of JMeter was not really satisfying especially for maintenance of test cases and the load testing should not cost anything at least at the moment, we should definitely this opensource tool a try. Especially the combination of the recorder and the presenter converter scripts to java looks promising. Maybe we could reuse the page object locators from our Selenium tests?

    Hubert Klein Ikkink (JDriven): Writing Documentation with Asciidoctor Is Awesome

    Focus on content instead of formatting in your documentation! With this tool it seem to be possible to really versioning and therefore to diff your documentation between commits. And still you can generate via templates modern output formats e.g. like HTML 5 or PDF. With a clever combination of features you can annotate your code with markers, to reuse this actual code between this markers in your documentation. And via ASCII art you can generate simple diagrams too. I will absolutely try this on my private projects soon.

    Community Hall – Meet the libs

    The motto was: show me your favorite opensource lib and I show your mine:

    Sven Ruppert again – Proxybuilder: Change the behavior of deep code for different purposes of CDI eg. Metrics, Logging or testing. Maybe interesting for my future tests.
    Roland Huß – Jolokia: JMX Bean access via JSON over HTTP, interesting but don’t know if I ever need this
    ? – Asciidoctor again: Jump additional over some of tool integrations
    ? – Keycloak: If I ever need a SSO or IDM solution for my private projects this will the first citizen in my tool chain.
    ? – Wildfly swarm: Interesting but actually I did not touch JBoss or Wildfly in my projects.

    Dinner

    Generally very good food, I had not expected this here. At dinner I meet at my desk with some staff of canoo, which set up the voting machines at Javaland too. Nice and diverting talk, thank you guys!

    That’s it!

    , , , , , , , , , , , , ,

    Leave a comment

    “Bob the Builder: Build/Deploy of #ADF enterprise applications” – I’m a speaker at #DOAG2015:

    csm_2015-Konferenz-Ausstellung-Logo_02_373181671d

    Today my presentation is confirmed:  “Bob the Builder: Build/Deploy of ADF enterprise applications”.

    I will speak over our experiences with following

    • build tools
    • deployment tools
    • architecture
    • versioning & branching
    • continuous integration
    • hot deployment in development
    • compile & runtime dependencies

    If you speak german and you are interested in some of this, you should come and attend DOAG 2015.

    , , , , , , , , , ,

    Leave a comment

    ADF Archtitecture Practice – JDeveloper Silent Install of Extensions

    This article describes how to standardize your JDeveloper Installation as requested in Planning & Getting Started – Team, Skills and Development Environments. It is part of the ADF Architecture Practice lessons and describes the installation with examples for windows.


    Version 12.1.x

    There is a tool ojwebupdate to handle this. It is fully supported but it’s not documented at the moment, documentation is planned for 12.1.4. But you can get a lot of info, if you call:

    ojwebupdate /?
    

    The easiest thing is to download your reqired extension from the update centers. The update centers can be updated too, so the best thing is to call “Check for updates” in a manual installation and then look in your JDveloper system directory for a file updatecenters.xml.

    Eg. if you want to install the extension “JUnit Integration” for version 12.1.3 in Windows 7 you have to go to the url, which is listed under “Official Oracle Extensions and Updates” by default in file

    C:\Users\[Your User]\AppData\Roaming\JDeveloper\system12.1.3.0.41.140521.1008\o.ide\updatecenters.xml
    

    At the moment this is http://www.oracle.com/webfolder/technetwork/jdeveloper/downloads/1213center.xml. Open this link, follow the link to “JUnit Integration” and download the required version. The right version can be determined by checking the requirement against your JDeveloper version or other extensions, you can find this information in the Help – About dialog. Or easier – you look at version, which version the manual installation would be installed and download this.

    Then you can call installation with following batch file:

    set oracle_home=C:\Oracle\JDev121300
    %oracle_home%\jdeveloper\jdev\bin\ojwebupdate -zips=[Path]\junit.zip
    

    Extensions can be depending on another extension, you see this in the requirements section of theurl or when you try to install a single extension in a fresh manual installation. In this case you have to install the extensions in the right order.


     

    Version 11.1.1.x
    The downloading of the file is similar to above, for version 11.1.1.7 you should download “JUnit Integration” extension at the moment from http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/131167.xml.

    You can simply unzip the extensions into your installation. The target depends from the extension itself. Therefore open the zip file and look into the META-INF\bundle.xml file. If there is a tag , then this is the target. If this tag does not exist, the default target is %oracle_home%\jdeveloper\jdev\extensions.

    The following batch will install “JUnit Integration” and “JUnit Integration for JDBC” extensions in the right order (as the second requires the first) in JDeveloper 11.1.1.7.:

    set oracle_home=C:\Oracle\JDev111170
    unzip -o -q junit_bundle -d %oracle_home%\jdeveloper
    unzip -o -q junit-j2ee_bundle.zip -d %oracle_home%\jdeveloper\jdev\extensions
    rem housekeeping
    rmdir /S /Q %oracle_home%\jdeveloper\META-INF
    rmdir /S /Q %oracle_home%\jdeveloper\jdev\extensions\META-INF
    

    That’s it!

    , , , , , ,

    Leave a comment

    ADF Archtitecture Practice – JDeveloper Silent Patch

    This article describes how to standardize your JDeveloper Patching as requested in Planning & Getting Started – Team, Skills and Development Environments. It is part of the ADF Architecture Practice lessons and describes the patching with examples for windows.


    Version 12.1.x

    In this version  the Oracle OPatch is delivered with the silent installation of JDeveloper.

    All what you need is the patch file for your platform (e.g. p19591087_121300_Generic.zip for JDEVADF SECURITY PATCH UPDATE 12.1.3.0.0 CPUOCT2014). Unzip this patch file.

    Then you call batch file similar to:

    set oracle_home=C:\Oracle\JDev121300
    pushd [path]\19591087
    %oracle_home%\OPatch\opatch apply -silent
    

    Revert the patch is similar, the response should look like

    set oracle_home=C:\Oracle\JDev121300
    pushd [path]\19591087
    %oracle_home%\OPatch\opatch rollback -id 19591087 -silent
    

    In Line 3 you have to enter the patch number, which has to be reverted after -id.


    Version 11.1.1.x
    In some of this versions Oracle OPatch is not delivered with the silent installation of JDeveloper. Please check if %oracle_home%\oracle_common\OPatch does exist. If not – you can download the latest version of OPatch here. Please select your Platform and Release 11.1.0.0.0  as this correspond to your JDeveloper version. Unzip the downloaded file.

    In some versions (at least till 11.1.1.1.5) you need for the first patch a default product.xml file in the right place, as this cannot be created silently. Change the highlighted lines according to your environment:

    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <product>
    	<name value="SA_JDEV"/>
    	<version value="11.1.1.5.0"/>
    </product>
    

    For older versions of opatch maybe you have to add a response file for opatch, which you can create as described here.

    Then you need the patch file for your platform (e.g. p19591065_111170_Generic.zip for JDEVADF SECURITY PATCH UPDATE 11.1.1.7.0 CPUOCT2014). Unzip this patch file.

    Then you call batch file similar to:

    set oracle_home=C:\Oracle\JDev111170
    set java_home=%oracle_home%\jdk160_24
    rem opatch_home=[your unzipped OPatch home]
    set opatch_home=%oracle_home%\oracle_common\OPatch
    rem workaround for BUG 9613778: OPATCH-STAND-ALONE: ERROR "OUI-67124:INVENTORY CHECK FAILED" ON GERMAN WINDOWS
    rem set _JAVA_OPTIONS="-Duser.language=en"
    rem workaround for silent creation of product.xml till at least version 11.1.1.5
    rem if not exist %oracle_home%\product.xml copy product.xml %oracle_home%\product.xml /V /Y
    rem if not exist %mw_home%\jdeveloper\product.xml copy product.xml %mw_home%\jdeveloper\product.xml /V /Y
    pushd [path]\19591087
    rem use switch -ocmrf, if you have an older opatch version, which  requires a response file 
    rem use switch -jdk, if you have the downloaded opatch version
    rem cmd /c %opatch_home%\opatch apply -silent -ocmrf ocm.rsp -jdk %oracle_home%\jdk160_24
    %opatch_home%\opatch apply -silent
    rem Workaround for BUB 9613778: OPATCH-STAND-ALONE: ERROR "OUI-67124:INVENTORY CHECK FAILED" ON GERMAN WINDOWS
    rem set _JAVA_OPTIONS=
    
    Reverting patches is similar to 12.1.x.
    set oracle_home=C:\Oracle\JDev111170
    set java_home=%oracle_home%\jdk160_24
    rem opatch_home=[your unzipped OPatch home]
    set opatch_home=%oracle_home%\oracle_common\OPatch
    pushd [path]\19591087
    rem use switch -ocmrf, if you have an older opatch version, which  requires a response file 
    rem use switch -jdk, if you have the downloaded opatch version
    rem cmd /c %opatch_home%\opatch rollback -id 19591087 -silent -ocmrf ocm.rsp -jdk %oracle_home%\jdk160_24
    %opatch_home%\opatch rollback -id 19591087 -silent
    

    That's it!

    , , , , , ,

    1 Comment

    ADF Archtitecture Practice – JDeveloper Silent Install

    This article describes how to standardize your JDeveloper Installation as requested in Planning & Getting Started – Team, Skills and Development Environments. It is part of the ADF Architecture Practice lessons and describes the installation with examples for windows.


    Version 12.1.x

    In this version  the Oracle Universal Installer allows the silent installation of JDeveloper. All what you need is the installer file for your platform (e.g. jdev_suite_121300_win64.exe) and a response file. You can create your response file as described in the documentation:

    1. Run your product’s graphical installer or installer, as described in your product installation guide.
    2. For product installation, on the Installation Summary screen, click Save Response File to save your installation parameters to a response file.

    The resulting file should be look similar to the following code:

    [ENGINE]
    
    #DO NOT CHANGE THIS.
    Response File Version=1.0.0.0.0
    
    [GENERIC]
    
    #This will be blank when there is nothing to be de-installed in distribution level
    SELECTED_DISTRIBUTION=JDeveloper Integrated Server Suite~12.1.3.0.0
    
    #The oracle home location. This can be an existing Oracle Home or a new Oracle Home
    ORACLE_HOME=C:\Oracle\JDev121300\
    

    Then you call a command similar to:

    jdev_suite_121300_win64.exe -silent -waitforcompletion -responseFile [complete path]\response.rsp
    

    Deinstallation is similar, the response should look like

    [ENGINE]
    
    #DO NOT CHANGE THIS.
    Response File Version=1.0.0.0.0
    
    [GENERIC]
    
    #This will be blank when there is nothing to be de-installed in distribution level
    SELECTED_DISTRIBUTION=JDeveloper Integrated Server Suite~12.1.3.0.0
    
    #The oracle home location. This can be an existing Oracle Home or a new Oracle Home
    ORACLE_HOME=C:\Oracle\JDev121300\
    

    Then you call the deinstallation via following commands:

    set oracle_home=C:\Oracle\JDev121300
    rem %oracle_home%\oui\bin\deinstall.cmd -noconsole -silent
    "%oracle_home%\oui\bin\internal\ilaunch.exe" -noconsole -deinstall -silent ORACLE_HOME="%oracle_home%"
    

    Pay attention that we did not use line 2, as this exits your command shell on windows. But we want to have a return code and maybe doing some post deinstall work (Enhancement Request 19464646 is created). Instead we have looked what command deinstall.cmd generates and put this on line 3.


    Version 11.1.1.x
    For this version you need the generic installer (eg. jdevstudio11117install.jar) and the 32bit JDK 1.6.0_24 (this is the delivered version for the manual install, 64bit version is not supported but works for most cases but not all). First you have to extract the msi JDK Installer as described here. Then you have to create a file silent.xml which is the equivalent of response.rsp in 12.1.x.

    <?xml version="1.0" encoding="UTF-8"?>
    <bea-installer>
      <input-fields>
        <data-value name="BEAHOME" value="C:\Oracle\JDev111170" />
        <data-value name="COMPONENT_PATHS" value="JDeveloper and ADF/JDeveloper Studio|JDeveloper and ADF/Application Development Framework Runtime|WebLogic Server/Core Application Server|WebLogic Server/Administration Console|WebLogic Server/Configuration Wizard and Upgrade Framework|WebLogic Server/WebLogic JDBC Drivers|WebLogic Server/WebLogic Server Clients|WebLogic Server/WebLogic SCA|WebLogic Server/UDDI and Xquery Support"/>
        <data-value name="INSTALL_SHORTCUT_IN_ALL_USERS_FOLDER" value="yes"/>
        <data-value name="LOCAL_JVMS" value="C:\Oracle\JDev111170\jdk160_24\"/>
      </input-fields>
    </bea-installer>
    

    Then you can call Installation with following batch file:

    set mw_home=C:\Oracle\JDev111170
    set oracle_home==%mw_home%\oracle_common
    set java_home=%mw_home%\jdk160_24
    c:\windows\system32\msiexec.exe /i [complete path]\jdk1.6.0_24.msi /quiet ADDLOCAL="ToolsFeature,SourceFeature" INSTALLDIR="%java_home%" REBOOT=Suppress
    "%java_home%\bin\java" -jar jdevstudio11117install.jar -mode=silent -log=install.log -silent_xml=silent.xml
    

    You can call the deinstallation with following batch file:

    set mw_home=C:\Oracle\JDev111170
    set oracle_home==%mw_home%\oracle_common
    set java_home=%oracle_home%\jdk160_24
    %mw_home%\utils\uninstall\uninstall.exe -mode=silent -log=uninstall.log
    c:\windows\system32\msiexec.exe /x [complete path]\jdk1.6.0_24.msi /quiet REBOOT=Suppress
    

    That’s it!

    , , , , , ,

    Leave a comment

    ADF Archtitecture Practice Series

    From now on I will create a series of lessons to implement the knowledge of the ADF Architecture Course from Oracle ADF product management. Here you can find the videos and the presentations. This post will be the index of this lessons, so bookmark it for further use!

    ,

    Leave a comment

    Find problems when you develop: using XRebel with Oracle ADF

    Some days before ZeroTurnaround has released XRebel , a new tool to recognized problems in your web applications, when you make your developer test.

    This was promising, so I give it a short try for Oracle ADF applications. For this blog I use the Summit ADF application, delivered by Oracle, but I have tried with our own application too. Test is done in JDeveloper 12.1.2.

    After the download there are some easy steps of setup to do:

    First thing is to change an existing or add a new run configuration:
    2014-06-30 07 09 28

    2014-06-30 07 09 38

    Then edit this configuration

    2014-06-30 07 09 45

    and add XRebel path as described in the documentation:

    2014-06-30 07 11 16

    Save the configuration by pressing OK two times.

    Then open your Page and run it via the run configuration:

    2014-06-30 07 12 39

    As First you see one time a dialog to request and enter the trial license.

    Then you see the XRebel widget on the left side and after waiting some little time the first issues are shown.

    2014-06-30 07 28 34

    From the default configuration (which can be changed with the gear in the widget) there seems a problem with the size of the session and with SQL Queries. If you drill down to the queries tab on the SQL page you see the execute queries, sorted by execution time, maybe the app should execute some of the queries at least not before changed to the tab, where it is used?

    2014-06-30 07 29 20

    2014-06-30 07 29 27

    If you look at the session size, then interesting is, that most of the session size is hold on the ODL log manager. Maybe oracle should think about this result, maybe there is a better way to hold this data.

    2014-06-30 07 32 32

    So download XRebel and give it chance on your ADF application.

    , , , , ,

    Leave a comment

    Slides for my german presentation “Quality Assurance for ADF projects” available

    I have presented today on DOAG Development 2014 in Dusseldorf. For all non DOAG members – you can find the german presentation on slideshare too.

    2014-Development_Banner-Speaker-180x180

    , , , , , , , , , , , , , , , , , ,

    Leave a comment

    Follow

    Get every new post delivered to your Inbox.

    Join 121 other followers

    %d bloggers like this: