Oracle Forms 11 running as application in Java Webstart

According to my last post today I will show you the basic configuration for forms 11g.

Unfortunatly webstart in forms 11g it is not as easy as in 10g, but it works too!

As first you need an additional unique identifier “ifsessid” in parameter “serverURL” for forms. This prevents the use of a static jnlp in this case. Maybe it is possible to branch out the build of this unique identifier from the jnlp. I have decided instead to create the the jnlp from a java server page. This helps me additional to use forms parameters, which I will describe in a later post. Sure there maybe exist other ways to build the jnlp.

Let’s start:

Again I assume you have an running unix or linux application server with forms 11g.

As first you need the webstart_11g.jsp in folder public_html under a JDeveloper project. The marked lines provides the identifier:

<%@ page contentType="application/x-java-jnlp-file" language="java" import="java.sql.*"%>
<%@ page session="true"%>
<%response.setDateHeader ("Expires", 0); //prevents caching at the proxy server%>
<%
  long time = System.currentTimeMillis();
  String sessid = String.valueOf(time);
%>
<jnlp codebase="http://localhost.localdomain:9001/forms/java/">
  <information>
    <title>Webstart Test Oracle Forms 11g</title>
    <vendor>develishdevelopment.wordpress.com</vendor>
    <description>Webstart Test Oracle Forms 11g</description>
  </information>
  <security>
    <all-permissions/>
  </security>
  <update check="timeout" policy="always"/>
  <resources>
    <j2se version="1.6.0"/>
    <jar href="frmall.jar" download="eager" main="true"/>
  </resources>
  <applet-desc name="Webstart Test Oracle Forms 11g" main-class="oracle.forms.engine.Main" width="990" height="640">
    <param name="background" value="no"/>
    <param name="logo" value="no"/>
    <param name="serverApp" value="default"/>
    <param name="lookAndFeel" value="oracle"/>
    <param name="allow_debug" value="true"/>
    <param name="separateFrame" value="false"/>
    <param name="em_mode" value="1"/>
    <param name="latencyCheck" value="true"/>
    <param name="networkRetries" value="240"/>
    <param name="serverArgs" value="module=test.fmx useSDI=yes"/>
    <param name="serverURL" value="http://localhost.localdomain:9001/forms/lservlet?ifcfs=http://localhost.localdomain:9001/forms/frmservlet?config=jpi&ifsessid=formsapp.<%=sessid%>"/>
    <param name="colorScheme" value="teal"/>
    <param name="splashScreen" value="no"/>
    <param name="dontTruncateTabs" value="true"/>
  </applet-desc>
</jnlp>

Now you need to deploy this jsp. First create a application server connection in JDeveloper version corresponding to your forms weblogic server. I have forms 11.1.1.2.0, which runs on weblogic 10.3.2. So I have to use JDeveloper 11.1.1.2.0. See oracle support information for supported JDeveloper version for your environment. Right click on you Jdeveloper project with the jsp an select deploy. Following are the steps in the deploy wizard:

  • Deployment Action
    • Deploy to application server
  • Select Servers
    • Application Servers: your application server
    • Overwrite modules of the same name: select
    • Deploy to all server instances in the domain: unselect
    • Deploy as a standanlone Application: select
  • Server instances
    • List Standalone Servers and Cluster: select your forms cluster or your forms server (WLS_FORMS)
  • Summary: finish

In the project properties change the deployment properties to set your context root, which will be later part of your url:

Set context root.

If you redeploy this jsp, you may wonder that your change is not immediatly shown. You can solve this by dropping the former deployment before redeploying or you add following files to your JDeveloper Project under folder public_html\WEB-INF:

weblogic.xml:

<weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd" xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
  <jsp-descriptor>
    <page-check-seconds>0</page-check-seconds>
  </jsp-descriptor>
  <container-descriptor>
    <servlet-reload-check-secs>0</servlet-reload-check-secs>
    <resource-reload-check-secs>0</resource-reload-check-secs>
  </container-descriptor>
  <context-root>webstart_11g</context-root>
  <fast-swap>
    <enabled>true</enabled>
    <refresh-interval>1</refresh-interval>
  </fast-swap>
</weblogic-web-app>

web.xml:

<?xml version = '1.0' encoding = 'windows-1252'?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"></web-app>

Complete workspace you can found here: webstart_11g.zip

Now start java webstart with your jnlp url, here is an example in linux:

./javaws http://localhost.localdomain:9001/webstart_11g/webstart_11g.jsp

Java webstart comes up with the standard test.fmx from the forms services installation:

webstart_11g_succesful

That’s all!

, , , ,

  1. #1 by Carlos Llanos on June 7, 2013 - 15:56

    I tried your solution and it works very well. I read that your solution works with SSO. We are using OID and the USNChanged Approach to authenticate with Active Directory. Can you give me more specifics on how you made your solution work in my case?
    We we do greatly appreictae it!
    Carlos Llanos

    • #2 by Torsten Kleiber on June 8, 2013 - 20:09

      I did not mentioned such information in my post.

      We did not use a real sso solution with forms, instead we overwrite the on logon trigger and use a java bean to get the user from the os before. So the user must logged into windows succesfully before his roles are checked against database tables. So authentication is a little bit like kerberos.

      In adf applications we us really kerberos authenticator and the same database tables.

  2. #3 by Christian on June 28, 2013 - 07:04

    Hello Torsten,

    we are working with webforms too.
    In your solution is it possible to handle frame close events via forms (ask the user “are you sure you want to close…?”) or will the applet frame just be closed(and what about background threads – is the JVM staying alive in background?)?

    We are setting the session id initial to “;ifsessid=formsapp.1” – then it is determined by the forms engine later – and you can create a static jnlp file.

    Kind regards Christian

    • #4 by Torsten Kleiber on June 28, 2013 - 18:39

      Hi!

      We close the applet without a question. This is not reqired from our users.

      Yes – unfortunatly the jvm staying in the background after the close at our servers. There is no such problem on our developer laptops. There are several blogs around the problem, that the jvm is not closed after exiting webstart. But I did not found a solution till now.

      For the static jnlp – this is veriy interesting. But we have additional reqirement to hand over variable parameters to forms, so we need the jsp anyway.

      Kind regards
      Torsten

  3. #5 by Christian on July 1, 2013 - 07:05

    Hi,

    is it possible that there is an other patch version installed – I think since patch 6 there is a background thread that keeps the JVM alive.
    I think you can handle it by deriving a subclass from oracle.forms.engine.Main and override the destroy() method with a final call to System.exit() or maybe the cleaner solution: exitApplet() .
    If you do not need sophisticated things then you can put the dynamic jnlp building jsp into the forms directory, there it is interpreted and executed as well – so you do not need to install a new deployment.

  4. #6 by Frank on May 22, 2014 - 07:54

    Hi all,

    to solve the problem that keeps the jvm alive, call formsMain.destroy() just before System.exit(). The problem exists since
    FMW 11.1.1.7 (not in 11.1.1.4, 11.1.1.5 and 11.1.1.6 not tested).

    Best Regards,

    Frank

  5. #7 by Dan on August 17, 2014 - 13:04

    Hi Frank,

    I am quite new to forms:
    where formsMain.destroy() is coming from?

    Thanks a lot,

    Dan

  6. #8 by Javier Viquez on September 4, 2014 - 21:06

    Thanks for your post I almost here ,but when I test on the Enterprise Manager after deploy of webstart_11g, I get this error when pressing test link: http://siembrawls02.afpsiembra.com:9001/webstart_11g

    Error 403–Forbidden
    From RFC 2068 Hypertext Transfer Protocol — HTTP/1.1:
    10.4.4 403 Forbidden …….

    What can it be?

    Thanks

  7. #10 by Javier Viquez on September 5, 2014 - 19:45

    Thanks, I’ve corrected error, but now, JAVA ever I try “javaws http://siembrawls02:9001/webstart_11g/webstart_11g.jsp” is prompting something like:

    Running this application is a security risk etc etc, and I have to mark a checkbox, but I doesnt found how to make java remember my choice.

    Thanks

    • #11 by Torsten Kleiber on September 5, 2014 - 19:58

      Without seeing the exact messages, this seems to me, that you have an outdated jre 7 installation. Upgrade to the latest jre 7 and the error should gone.

      If you cannot upgrade, than you have to check the possibilities to bind your application to specific outdated jre versions. This should be documented in the jre documentation, my knowledge of this is unfortunatly restricted and this area has a lot of modification over the last jre releases.

    • #12 by Christian on October 17, 2014 - 09:40

      In newer Java-7-Releases the jnlp needs also the href attribute to itsself

      After doing this you are nearer to the solution: I am not sure if you can do these things with self signed certificates – but if you are inside an enterprise environment where you have administrative access to the clients you can do this by adding your certificates the the jre (jre_path/lib/security/trusted.libraries << this is a jks with default password found via google – that you can modifiy with your certs). You can also change the deployment properties to get aware of some javaws-messages

  8. #13 by Daniel Uzcategui on October 16, 2014 - 20:14

    Hi sir, i am very interested about doing this with our application can you share more info about doing this i have never used jdeveloper. thanks in advance

    • #14 by Torsten Kleiber on October 17, 2014 - 05:31

      Without any knowledge in JDeveloper this will not be easy, there are a lot of tutorials in the web to start with JDeveloper. Or maybe you find somebody in your enterprise to help you?

    • #15 by Christian on October 17, 2014 - 09:44

      I think there is no need fo JDeveloper – Eclipse can do same things in nearly the same way

  9. #16 by farookh on July 28, 2015 - 07:56

    Really appreciated brother for publishing such a wonderful articles .. I able to run the test.fmx without any issue.

    While deploying my own customized forms which uses some other jar file apart from frmall.jar like frmwebutil.jar ,icons.jar,JImageViewer.jar,jdic.jar,eHTMLBrowser.jar .. I am getting error “Error:JAR resources in JNLP file are not signed by same certificate”

    FYI .. I am running test.jnlp file locally from c:\ drive and test.jnlp codes are as well.

    Webstart Test Oracle Forms 10g
    develishdevelopment.wordpress.com

    Webstart Test Oracle Forms 10g

    • #17 by Torsten Kleiber on July 28, 2015 - 18:34

      Yes – you habe to sign all jar’s with the same certificate. Maybe https://pitss.com/us/2013/10/24/how-to-modify-custom-jar-files-with-permissions-and-codebase-attributes/ can help you. We sign here all jar’s with our own certificate as we roll out the jre bundled with this trusted certificate. Not all companies have bought such certificates, so maybe this a very special solution.

    • #18 by Daniel Kampf on August 3, 2015 - 11:19

      Hello farookh,

      I had the same problem when doing so – you have to create a separate ressource file for jars that have been signed with a different certificate, e.g.:

      Within this ressource file you can group your jars, that use the same certificate:

      ?xml version=”1.0″ encoding=”UTF-8″?>

      Activation
      Sun Microsystems, Inc.

      I hope that helps you.

      Best regards
      Daniel

    • #19 by Daniel Kampf on August 3, 2015 - 18:24

      Somehow my comment got messed up, here the link to the ressource file again:

      Ressource-file itself:

      Activation
      Sun Microsystems, Inc.

      <jar href="pitssicon.jar" size="" /

      • #20 by Daniel Kampf on August 3, 2015 - 18:28

        Ressource-file itself:

        Activation
        Sun Microsystems, Inc.

        <jar href="pitssicon.jar" size="" /

    • #21 by Daniel Kampf on August 3, 2015 - 18:48

      one last try:

      <resources>
      <j2se version="1.8.0"/>
      <extension name="oraclejars" href="http://HOSTNAME:9001/webstart_11g/oraclejars.jnlp"/&gt;
      <extension name="pitssjars" href="http://HOSTNAME:9001/webstart_11g/pitssjars.jnlp"/&gt;
      </resources>

      Ressource-file itself:

      <?xml version="1.0" encoding="UTF-8"?>
      <jnlp codebase="http://vmdaka:8888/forms/PitssJava"&gt;
      <information>
      <title>Activation</title>
      <vendor>Sun Microsystems, Inc.</vendor>
      <offline-allowed/>
      </information>
      <security>
      <all-permissions/>
      </security>
      <offline-allowed/>
      <resources>
      <jar href="jacob1.jar" size=""/>
      <jar href="pitssicon.jar" size=""/
      </resources>
      <component-desc/>
      </jnlp>

      • #22 by Farookh on August 24, 2015 - 05:37

        Dear Daniel , Thanks for the help .. my code are as below now however i can’t see any error nor any output

        1)

        Webstart Test Oracle Forms 10g
        mercator.com

        Webstart Test Oracle Forms 10g

        2)

        <jnlp codebase="http://lnxdevvm573.hq.emirates.com:8888/forms/java/&quot;;

        Activation
        Sun Microsystems, Inc.

        ~

  10. #23 by David on August 3, 2015 - 12:18

    Hello Torstein,

    I am trying to run your web application on forms 11g R2 (11.1.2.2), and when I execute the command from msdos:
    C:\Program Files (x86)\Java\jre6\bin>javaws http://localhost:9001/webstart_
    11g/webstart_11g.jsp
    It only opens the java console and not the app.
    I have changed the webstart_11.jsp file replacing localhost.localdomain with my machine name and the config=jpi for config=default, but without any changes…
    Could you help me please?

    Thank you in advance!

    • #24 by Torsten Kleiber on August 3, 2015 - 17:58

      In my jsp above there is no config=default. So which file do you change?

      If webstart not start it should normally show an error (look at the details) or an help dialog.

      Are you sure that test.fmx exists?

      Are you sure you have the same port 9001 for forms?

      Do you have configured another Listen Port or Listen Address defined for managed server WLS_FORMS?

      We have only 11.1.2.1 here at the moment, so maybe something has changed there.

      • #25 by David on August 4, 2015 - 10:21

        Thank you for your quick reply.

        I have the weblogic(10.3.6) and forms 11.1.2.2 running perfectly.
        When I enter this Url:
        http://mymachine:9001/forms/frmservlet or
        http://mymachine:9001/forms/frmservlet?config=default
        i get the test.fmx form correctly.

        What I refer with changing the config from “jpi” to “default” is because I dont have the “jpi” section in my formsweb.cfg, and I thought this parameter “jpi” was refering to a section in this file.

        Maybe in 11.1.2.2 it’s needed another parameter, could you please tell me what or where do I have to search in order to find which parameter is missing?

        I really appreciate your feedback.

        Thank you!

      • #26 by Torsten Kleiber on August 4, 2015 - 18:51

        As mentioned before actually I don’t have an 11.1.2.2 environment. I need some time to implement such an environment. JPI was in the past to differentiate between oracle jinitiator (an sun jre 1.3 fork) and sun Java PlugIn. As in the meantime java is property of Oracle this seems to have changed now.
        You could try to run
        http://mymachine:9001/forms/lservlet?ifcfs=http://localhost.localdomain:9001/forms/frmservlet?config=default
        May be that lservlet (Listener Servlet) does not exist or paramter ifcfs is not guily anymore

    • #27 by Daniel Kampf on August 3, 2015 - 18:30

      okay, I give up posting the code with the comment functionality :)

      • #28 by Christian on August 5, 2015 - 08:26

        I don’t think the interface has changed, so changing jpi with your config should work.
        To be sure, your can run it as applet and then debug the website with firebug / chrome / etc to find out the url.
        Some parameters from the section are transferred to the website and have to be transferred manually to your jnlp ( especially the classpath and [url-] parameters for your form )

  1. Java Webstart with Forms – jp2lauchner.exe workaround | daniel4pitss

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 81 other followers