23 February 2016

OU Webservices Practice 5.1 alternative

To use the Glassfish JAXB RI instead of the default Eclipse MOXy implementation in Weblogic 12.1.1 add this to the beginning of your %DOMAIN_HOME%\bin\setDomainEnv.cmd. %MW_HOME% is set to the installation location of WebLogic.

if NOT "%PRE_CLASSPATH%"=="" (set PRE_CLASSPATH=;%PRE_CLASSPATH%)
set PRE_CLASSPATH=%MW_HOME%\modules\databinding.override_1.0.0.0.jar%PRE_CLASSPATH%


On Weblogic 12.2.1 you should use WL_HOME (=%MW_HOME%\wlserver) instead of MW_HOME.

21 February 2016

Link Blogger to Google Drive

Blogger supports including images from Picassa, but when you include an image as a share link from Google drive, this seems to work initially, but the converted link does not work anymore after a while. So, you end up, saving your images twice in google storage.
Here's a post on converting a Google Drive link for usage with Blogger.

20 February 2016

OU Webservices Excercises Module 13: JAX-WS only

 Exercise 13-1

  1. Generate SSL artefacts
    • Edit certgen.bat (do not double click). Adapt the paths at the top of the file to reflect the correct paths on your machine.
      • The individual steps that are executed by the script are explained in Practice A-2
    • Run the script from the command line
  2. Configure WebLogic for WS-Security
    • Edit sslconfig.bat (do not double click). Adapt the paths at the top of the file to reflect the correct paths on your machine.
    • Edit sslconfig.py.  Adapt the paths at the top of the file to reflect the correct paths on your machine.
      • The script uses the WebLogic Scripting Tool (WLST). The  same procedure using the administration Console is explained in Practice A-3. 
    • If WebLogic is not running, start it.
    • run sslconfig.bat from the command line 
    • The script stops WebLogic. Start it again afterwards.
    • Connect to the WebLogic Admin Console over SSL, using URL https://localhost:7002/console
      • The browser warns you because it does not know the certificate authority
        •  Verify the certificate
        • Approve the connection
  3. Open theCardDecksWS project
  4. If you did not enable JAX-WS HTTP dumping in Excercise 5-7, do it now.
  5. Add a new library to NetBeans using Tools> Ant Libraries
    • Create a new library
      • Name: WebLogic Web Services API
      • Type:  Server Libraries
    • Press Add JAR/Folder, browse to the WebLogic folder and add modules/ws.api_2.0.0.0.jar
    • Click OK   
  6. Add the "WebLogic Web Services API" library to the CardDecksWS project
  7. View the policy file you will use
    • Expand Libraries> Oracle WebLogic Server> weblogic.jar> weblogic.wsee.policy.runtime
    • Double click Wssp1.2-2007-Wss1.1-UsernameToken-Plain-X509-Basic256.xml 
    • Examine the file
    • Close the file
  8. Open ejbs.CardDeckSessionBean.java
  9. Annotate the class with @Policy to 
    • use the policy you have just viewed 
    • add it to the WSDL
  10. Using the @Policies and   @Policy annotation on every method indicate that
    • webservice calls should be signed
    • webservice calls should be encrypted
    •  this should be added to the WSDL
  11. Correct any errors and save
  12. View the WSDL at http://localhost:7001/CardDeckSessionBean/CardDeckSessionBeanService?wsdl
    •  Notice the wsp1_2:Policy elements that have been added
  13. Open the GenericCardGameWS project in NetBeans
  14. Open games.CardGameService
  15. After the creation of the port in the createCardGame method, add code to use WS-Security, as shown in slides 13-17 to 13-19
  16. Refresh the JAX-WS artefacts and cached WSDL
    • In the Web Service References Node, right click the CardDeckSessionBeanService and choose Refresh
    • Select the checkbox to also replace the WSDL
    • Click Yes
  17. Correct any errors and save
    •  Clear the WebLogic Server Output window (right click>clear)
  18. Open the Weblogic Test Client at http://localhost:7001/wls_utc
  19. Enter WSDL http://localhost:7001/GenericCardGameWS/CardGameService?wsdl
    • Create a cardGame with 1 deck and 2 jokers
    • Inspect the SOAP messages
      • View the Oracle WebLogic Server output window in NetBeans
      • Compare the calls to Try to see the difference between the calls to 
        • CardGameService
        • CardDeckSessionBeanService

 Exercise 13-2

  1. Check the time between the first and last message in a call in the previous exercise
  2. In the CardGameService class, modify the usage of the CarDeckSessionBeanService. Apply the same kind of optimisations on the service as in step 2 in the activity guide.
  3. Apply the same kind of optimisations on the CarDeckSessionBean port as in step 3 in the activity guide
  4. Correct errors and save. 
  5. Check the time again between the calls when creating a card game.

19 February 2016

WebLogic 12.1.2 zip install: terminalio to read the password securely is not found


My WebLogic 12.1.2 install from the zip distribution aborted after asking for the domain admin user with the error message:

Native Library(terminalio) to read the password securely from commandline is not found
It appears that this is a different symptom of the same error I had working with Weblogic 12.1.1: the native libraries delivered with WebLogic are not in the PATH. My system is a 64 bit windows system, so i need to add the libraries for this platform to avoid this error.
I added one line to %WL_HOME%\wlserver\server\bin\setWLSEnv.cmd
set WL_HOME=C:\wl12120
@REM added the next line
set PATH=%WL_HOME%\server\native\win\x64;%PATH%
If you do this, the installation and the configuration of a default domain run smoothly. As explained in my previous post, after the domain creation, also add this line to the domain envionment setup file %domain_dir\bin\setDomainEnv.cmd. If you don't you'll get warnings about Weblogic reverting to less efficient file reading libraries etc.

13 February 2016

Oracle SQL info

  • Oracle 11g SQL reference
  • SQL developer keboard shortcuts
    •  Tools>preferences>shortcut keys
    • CTRL+SHIFT+D: copy current line down
  • Changing the password
    •  change it in the database
alter user user_name identified by "new_password" replace "old_password"

8 February 2016

JPA CriteriaQuery call structure

The sequence of calls and the objects involved in a CriteriaQuery is complex at first. 
CriteriaQuery uses a fluid builder patters which mimics the structure of a JPQL/SQL query. I highlighted the creation of the parameters and the calls in which they are used.
The parameters are not exactly those in the API, i oversimplified to give an idea of the general structure of a criteria query.


UMLet UML drawing & scripting (edit)

UMLet is a basic free and open source drawing tool for UML diagrams. It is witten in java and comes in a standalone version, an eclipse plugin and a web hosted edition (UMLetino). In the market of UML tools (cfr. an earlier blog on Astah) it has a unique take on modelling.

First it is a drawing tool. Real UML tools try to have one model for which each diagram gives a different, but consistent perspective. UMLet just lets you draw and link UML components. But it does not assist you in UML syntax or consistency. Neither does it have any code or documentation generation features as the higher end tools have.
The advantage is that UMLet does not have the overhead of defining the model behind the diagram. Also it does never get in the way when you want to do something that is not supported by UML or your tool.

Second where you expect a drawing tool to be targeted on a strong, intuitive, graphic and interactive user interface, each element in UMLet is backed by a notepad like text specification. You draw your diagrams, elements and connections using a point and click interface. Modifiying elements, changing style and appearance, adding details is done in one associated text box. The text language is compact and simple.  This makes UMLet a very geeky tool. Sometimes you have to compose elements, like sequence diagram lifelines, from several subparts. On the other hand, you never have to wade through a hierarhy of interactions dialogues to fill in all characteristic of an element you have definied.

Once you get the knack of it, the speed of working with UMLet is matched by few other tools.It is a good fit for taking agile modeling  beyond the whiteboard. You can easily extend the toolboxes with elements or create your own. The tool is best used on small modeling efforts, as, being a drawing tool, different diagrams representing the same element will not automatically remain in sync.

The default toolboxes do not have all UML elements and are are a bit sloppy in UML syntax. As you can easliy modify and expand the toolboxes, this can be amended, but there is a risk that UML newbies pick up bad UML manners from the tool:

  • uses <<includes>>, <<extends>> instead of <<include>>, <<extend>>
  • synchronous messages  in sequence diagrams do not have a filled arrow head
  • return arrows in sequence diagrams do not have a dashed line
  • no found message in sequence diagram 
  • no * cardinality as in the UML standard 
There is a set of "all in one" diagrams that present entire diagrams as one element that you can configure by editing the properties. I did not find any way to interact with them graphically. You are really scripting your diagram in text, like in the LaTeX days of text processors.

Here's a nice intro video.

2 February 2016

Java plugin deprecated in Java9

With Java9 the java web plugin will be discontinued. Browsers like Microsoft Edge are removing plugin support, so this is a logical step.
Java's origins are in embedded execution, running applets in the browser, using the plugin.
Oracle has a whitepaper with migration options.