Thursday, January 27, 2011

ADF Swing Webstart deployment

If you are having a problem with a null password when deploying your adf swing app via webstart on a weblogic server you can try the below suggestions. The problem occurs because the connections.xml file does not contain a password for security reasons. The password should be stored in your store and configured in your application but I havent had enough time to figure out how this would work.

Suggestion 1) Use a datasource instead of the JDBC in your am configuration. (1st prize solution)

Suggestion 2) Try the -Djps.app.credential.overwrite.allowed=true (didnt work for me)

Suggestion 3) Untried: Create a secure app and add your db user to the store.

If all else fails give this a go: Enter a custom jdbc url in your database JDBC connection jdbc:oracle:thin:username/password@127.0.0.1:1521:XE

8 comments:

  1. hello

    did the first suggestion work for you (data source)? i have tried it and did not work,

    thnkx

    ReplyDelete
  2. Didnt have enough time to try it out will try give it a go today sometime.

    ReplyDelete
  3. Hi,

    You could try the following.

    1) Configure the DS on your weblogic server.
    2) Configure your Application module to use a datasource.
    3) Add this to your form code (replace the 127.0.0.1 and port with the correct values)

    Properties properties = System.getProperties();
    properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    properties.put(Context.PROVIDER_URL, "t3://127.0.0.1:7101");

    ReplyDelete
  4. Hi there Backmarker!

    Nice to see a fellow South African working in the ADF front!

    I faced this same null password problem. Eventually got around it by adding a login form to the application (I have also since hidden the login page so that the app starts and goes straight in).

    However, this means that our database connection is "hardcoded" in the app. We now have to deploy this app to 19 servers... that means I have to compile and build my ADF Swing app with 19 different database settings...

    Your suggestion of changing the INITIAL_CONTEXT_FACTORY is a nice idea, but, unfortunately, that too will mean hardcoding (the URL of the app server). Each app server in our org. will have a different appserver and different DB, but the same application.

    Any ideas?

    Thanks

    ReplyDelete
  5. Hi, Backmarker! Can you explain me more detail how to use your 1st suggestion? I have ADF Swing Webstart application, and I want to use global datasource which is situated on the Weblogic Server. Thank you for answer.
    Regards, Stanislav

    ReplyDelete
  6. Hi Stanislav,

    Will have a look at this tommorrow, the obvious way does not work the webstart app seems only to map the url need to check some configurations and will get back to you

    ReplyDelete
  7. Hi, Backmarker! Thank's for answer.
    I did how you described in your comment at February 10, 2011 10:10 PM. I Created datasource
    1) I Created datasource on my weblogic server.(name of datasource hrGlobal)
    2) I configured Application module to use this datasource.
    3) I overrided method getInfo(from JUEnvInfoProvider)
    and added there your form code
    "Properties properties = System.getProperties();
    properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    properties.put(Context.PROVIDER_URL, "t3://127.0.0.1:7101"); "(replacing the 127.0.0.1 and port with the correct values)
    When I run my WebStart application, i get an error:
    (oracle.jbo.DMLException) JBO-27200: Failure JNDI. Can't execute search of datasource in context hrGlobal

    P.S. When I use simple jdbc connection(in application module), my WebStart application is running without errors.
    Versions: WLS 10.3.3 JDeveloper 11.1.1.3.0
    Thank you for reply.
    Regards, Stanislav

    ReplyDelete
  8. Hi, I am using 11.1.1.4.0 but there should not be any difference I have given the implementation a go (with a jmx connection) and the datasource implementation and I could not get it to work. The only solution I could come up with was to override the DataSourceContext or add a provider int the DatabaseConnectionProviderFactory - this will be a bit of a hack and hard to get right.

    You will have to override a few classes add the correct weblogic jar, change security permissions, change the weblogic startup to include remote jdbc connections etc.

    So instead of this I suggest you contact oracle and if you still get no joy I will post some override code.

    ReplyDelete