Pages

Friday, December 5, 2008

Deploy your 11G webapp to a WebLogic Server

Deploying your web application from JDeveloper 11g to a WebLogic 10.3 Server is not so simple as with the internal WebLogic server of JDeveloper. Off course we need to install the WebLogic 10.3 and install the ADF runtime 11g to this server ( See my previous blog for this ).

The first step is to create the datasource in WebLogic. In the configuration of the ADF BC applications modules you can see what should be the jndi name in WLS. Default is this, the database connection name of the application with DS. For example database connection = scott then the jndi name will be jdbc/scottDS

Create the jdbc datasource in WLS

Very important, you must enable this datasource by selecting a target. Default the target is not selected and the datasource is disabled.
Add a war deployment to your application.
Give the application a root context.
Now we need to add a ear deployment to your application.

You have to select the just created war deployment profile. In the ear deployment contains the weblogic-deployment.xml where is defined that this application needs the adf 11g library
Now we can deploy the ear to WebLogic server
Here the result of the deployment
In the deployment view we can see our application with its j2ee modules
In the ADF 11g library deployment we can see the just deployed application as a reference to this library

33 comments:

  1. Thank you for sharing this valuable information!

    ReplyDelete

  2. Hi Edwin

    i deployed application to WLS 10.3
    evry thing done successufully bu the applicationModule connection error

    here my steps:
    -install ADF Runtime
    -creating domain
    -creating JDBC connection as :
    ----jndi: jdbc/connectionDS
    ----using thin
    ----using url:
    jdbc:bea:oracle://localhost1521;ServiceName=XE;User="***";Password="***";
    ----using Driver:
    weblogic.jdbc.oracle.OracleDriver
    ----connection tested and success
    ----then applyed to server instance

    in my application AM using DS instaed of URL

    - creating WAR then EAR
    - deploy EAR to EAR
    -deploy application to WLS

    then deployed Successuflly
    and page displaied
    but when open any page have BINDING then get this error:


    WARNING: Unable to locate the credential for key UCouncil in C:\bea\user_project
    s\domains\UCDomain\config\oracle.
    Dec 31, 2008 2:56:50 PM oracle.adf.share.jndi.ReferenceStoreHelper throwPartialR
    esultException
    WARNING: Incomplete connection information
    (Dec 31, 2008 2:56:51 PM PST)
    (Error) (HTTP) (BEA-101017)
    ([weblogic.servlet.internal.WebAppServletContext@59b3b6 - appName: 'UCApplicationEAR', name: 'uc', con
    text-path: '/uc', spec-version: '2.5', request: weblogic.servlet.internal.Servle
    tRequestImpl@1b6c763[
    GET /uc/faces/index.jspx?_adf.ctrl-state=979418204_3 HTTP/1.1
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
    Accept-Language: af
    UA-CPU: x86
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2
    .0.50727)
    Connection: Keep-Alive
    Cookie: JSESSIONID=mdKJJb4MNtbTM1f9H2HQqyJ0ny5HPGv0JjdpWSXBx9Z6bX0PhB29!-2087614
    88

    ]] Root cause of ServletException.
    oracle.jbo.common.ampool.ApplicationPoolException:
    JBO-30003: ??? ???? ????????? (BUIT.Development.UCouncil.model.UCouncilsLocal) ?? ??? ???? ????? ????? ???? ? ???????? ??????:
    at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2262)
    at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:3086)
    at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:453)
    at oracle.jbo.http.HttpSessionCookieImpl.useApplicationModule(HttpSessionCookieImpl.java:233)
    at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:424)

    Truncated. see log file for complete stacktracejava.lang.ClassCastException: weblogic.jdbc.wrapper.PoolConnection_weblogic_jdbc_oracle_OracleConnection cannot be cast to oracle.jdbc.OracleConnection

    at oracle.jbo.server.OracleSQLBuilderImpl.setSessionTimeZone(OracleSQLBuilderImpl.java:4953)
    at oracle.jbo.server.DBTransactionImpl.refreshConnectionMetadata(DBTransactionImpl.java:5054)
    at oracle.jbo.server.DBTransactionImpl.initTransaction(DBTransactionImpl.java:1280)
    at oracle.jbo.server.DBTransactionImpl.initTxn(DBTransactionImpl.java:6415)
    at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:249)
    Truncated. see log file for complete stacktrace)

    ReplyDelete
  3. Hi, Which jdbc driver did you use. Can you use the Oracle thin not XA driver.

    this is your problem.

    stacktracejava.lang.ClassCastException: weblogic.jdbc.wrapper.PoolConnection_weblogic_jdbc_oracle_OracleConnection cannot be cast to oracle.jdbc.OracleConnection

    thanks Edwin

    ReplyDelete
  4. first I thanktyou very much for response and i regard your time

    second
    that what i use
    i dont chose thin with XA absolutly
    i chose NOT XA
    But Strangely when use regular Drive and URL
    that :
    oracle.jdbc.OracleDriver
    jdbc:oracle:thin@host:port;
    not success connection and get error messages and cannot activate changes
    then i use as WLS doc this
    weblogic.jdbc.oracle.OracleDriver
    jdbc:bea:oracle://localhost152;ServiceName=XE;

    i dont know is there any other configuration to AM or what?

    ReplyDelete
  5. Hi,

    Are you using the oci lib to connect to the database .

    I always use the thin driver else you need to setup a net8 environment

    very strange your default connection url should work.

    can you send the datasource config of the config.xml of wls

    ReplyDelete
  6. Hi can you change your datasource xml. I have this and it is working fine

    <jdbc-driver-params>
    <url>jdbc:bea:oracle://localhost:1521</url>
    <driver-name>weblogic.jdbc.oracle.OracleDriver</driver-name>
    <properties>
    <property>
    <name>user</name>
    <value>scott</value>
    </property>
    <property>
    <name>portNumber</name>
    <value>1521</value>
    </property>
    <property>
    <name>SID</name>
    <value>orcl</value>
    </property>
    <property>
    <name>serverName</name>
    <value>localhost</value>
    </property>
    </properties>
    <password-encrypted>{3DES}982/AAjpaT0=</password-encrypted>
    </jdbc-driver-params>

    this is your config

    <jdbc-driver-params>
    <url>jdbc:bea:oracle://localhost:1521;ServiceName=XE</url>
    <driver-name>weblogic.jdbc.oracle.OracleDriver</driver-name>
    <properties>
    <property>
    <name>user</name>
    <value>UCouncil</value>
    </property>
    </properties>
    <password-encrypted>{3DES}4Fj+eUALXngbUW7f0zC3vQ==</password-encrypted>
    </jdbc-driver-params>

    ReplyDelete
  7. Hi
    i try your solution but but Sorry problem still

    really , strang indeed

    is must change AM dataSource to
    jdbc/****DS as WLS
    or keep as it java:comp/env/jdbc/****DS

    ReplyDelete
  8. Hi,

    it must be like java:comp/env/jdbc/****DS

    very strange.

    ReplyDelete
  9. I so sorry Edwin

    i get the problem

    it is windows 2008

    i change the platform then the default url work fine and application deployed smootly and work fine

    thanks alot
    and sorry for noisy

    ReplyDelete
  10. Hi! I have problems with navigation when I deploy my application on Weblogic server 10.3. In my application I have two pages. One page where I can see the records. In this page I have button Create with action to secound jspx page. When I press this button then the first form (where I could see all records) is empty - the create operation worked, but navigation to second page not. Navigation rules is in adf task flow. In default server all works correct. Where is the problem?

    Maybe when I deploy my application I need specialy deploy adf task flow or somewhere write something? If so, then can you explain me where? Any suggestions what to do.

    And when I insert "panelCollection" element in jspx page which I deploy to webLogic 10.3 and run the page then I can not see this "panelCollection" element. Why it is so. On default server all is ok! Maybe problems with ADF???

    I have in log:

    2009.26.3 20:12:52 oracle.adfinternal.controller.faces.lifecycle.JSFLifecycleImp
    l setLifecycleContextBuilder
    WARNING: ADFc: Replacing the ADF Page Lifecycle implementation with 'oracle.adfi
    nternal.controller.application.model.JSFDataBindingLifecycleContextBuilder'.
    2009.26.3 20:12:52 oracle.adfinternal.controller.util.model.AdfmInterface initia
    lize
    INFO: ADFc: BindingContext is present, using ADFm APIs for DataControlFrames.
    2009.26.3 20:12:52 oracle.adfinternal.controller.metadata.provider.MdsMetadataRe
    sourceProvider
    INFO: ADFc: Controller caching of MDS metadata resources ENABLED.
    2009.26.3 20:12:52 oracle.adf.controller.internal.metadata.MetadataService$Boots
    trap add
    INFO: ADFc: Loading bootstrap metadata from '/WEB-INF/adfc-config.xml'.
    2009.26.3 20:12:54 oracle.adf.share.security.providers.jps.CSFCredentialStore fe
    tchCredential
    WARNING: Unable to locate the credential for key AUGI in D:\bea\user_projects\do
    mains\base_domain\config\oracle.
    2009.26.3 20:12:54 oracle.adf.share.jndi.ReferenceStoreHelper throwPartialResult
    Exception
    WARNING: Incomplete connection information

    Best regards!

    ReplyDelete
  11. Hi, just a few checks.

    did you installed adf lib on wls and is this the same version as your local jdev.

    did you make a war/ ear deployment profile.

    did you make the jdbc datasource and targeted at the right wls server.

    do you run it on the admin server.

    do you have in the weblogic-aplication.xml still have the ADF listener.


    by the way you don't need to make a different deployment for task flows.

    check your am configuration and see how the datasource is called. it has to something like this jdbc/xxxxDS
    xxxx is your connection name.

    hope this helps

    ReplyDelete
  12. 1. I don't installed adf lib on wls it is necessary if I use Jdev 11g and Weglogic 10.3? If yes then can you say how to do it?

    2. I made war for Model and Viewcontroller and one ear for applicattion.

    3. I made the jdbc datasource and targeted it at the right wls server! By the way I can see data in my form, but I can't go to other pages by pressing button and can't see all elements in form (for example can't see panelCollection element).

    4. I run it on the admin server.

    5. In which directory is correct weblogic-aplication.xml file and If I have listener then I need it to remove?

    Best regards!

    ReplyDelete
  13. Hi,

    please see this how to install adf on wls

    http://biemond.blogspot.com/2008/11/installing-adf-11g-runtime-on-weblogic.html

    in your project home you have a folder \src\META-INF and in this the weblogic-application.xml is located.

    you can remove the listener class this is only necassary locally.

    thanks Edwin

    ReplyDelete
  14. What is difference between ADF Task Flow and Faces-Config? When I create navigation between pages with ADF task flow then the navigation don't work when I deploy my application to Weblogic 10.3. When I use default server then navigation works fine. With Faces_config in both situations all works ok - on Stanalone server and default.

    Where is the problem?

    Best regards!

    ReplyDelete
  15. Hi,

    the faces-config is the old way. adfc-config is the new way.

    but did you put the jsf pages in the adfc-config.xml file and select this file as run target in your project run options.

    thanks Edwin

    ReplyDelete
  16. Hi,

    I have registred domain www.augi.lv, there I need to write IP address. How can I get to my application where is written weblogic port and context root -
    http://85.254.224.235:7001/augi/ ?

    ok, you can set your ip adress on your network device with ifconfig or in your network adapter.

    or you can add this ip adress on the server in the wls console then wls will add this address on your network device , here you can change the port number too.

    to change the name augi you can change the war profile see this pic
    http://4.bp.blogspot.com/_earSixbe3dw/STmqRE4kuDI/AAAAAAAAB8w/_53_I7NaEcI/s1600-h/adf_deploy_5.png

    thanks

    ReplyDelete
  17. HI! I have problem when I tried to change weblogic listen port from 7001 to 80. When I changed from 7001 to 7777 then all works ok! But why not on 80? With apache all works ok on 80 too.

    I restart my weblogic server and then I have following errors:

    "Server failed to b
    ind to the configured Admin port. The port may already be used by another process.

    Unable to create a serve
    r socket for listening on channel "Default". The address 85.254.224.235 might be
    incorrect or another process is using port 80: java.net.BindException: Address
    already in use: JVM_Bind.

    Server failed
    . Reason: Server failed to bind to any usable port. See preceeding log message f
    or details.

    Unable to create a serve
    r socket for listening on channel "Default[2]". The address 127.0.0.1 might be i
    ncorrect or another process is using port 80: java.net.BindException: Address al
    ready in use: JVM_Bind.

    Unable to create a serve
    r socket for listening on channel "Default[1]". The address 192.168.0.102 might
    be incorrect or another process is using port 80: java.net.BindException: Addres
    s already in use: JVM_Bind.

    Server state ch
    anged to FAILED."


    Best regards!

    ReplyDelete
  18. ok ,

    it seems your port 80 is in use. probably by apache use netstat to check this out.

    but if you have apache on port 80 you can add a wls plugin in apache which routes it to port 7001

    see this http://biemond.blogspot.com/2009/02/high-available-weblogic-cluster.html

    see this part
    The last part is to configure Apache and the enterprise applications for High Availability.
    Install apache 2.2 and download the weblogic module for apache here.
    edit the httpd.conf add the following lines

    LoadModule weblogic_module modules/mod_wl_22.so

    ReplyDelete
  19. Hi! I want to know how to add prefix www to my domain? I can access my app. using augi.lv, but I want use www.augi.lv. Can you help me!?
    Maybe some good tutorials - step by step how to do this!?

    Best regards!

    ReplyDelete
  20. Hi,

    you have to this in your dns server at your provider

    and you can make a virtual host in apache and re-direct to the a alias with the wls plugin to wls.

    first take a look at your dns server

    ReplyDelete
  21. HI! Thanks for reply! I have DNS server addres and this is augi.lv, but I want www.augi.lv. I don't want to use apache. Other suggestions? Can I use only wls server? If yes, do you have step by step tutorial - how to do this? I think I need Virtual hosts and clusters, but don't know how to configure. Please help!

    Best regards!

    ReplyDelete
  22. Hi,

    Ok you got your own domain, make a sub entry on this domain. your provider should support this like mail or www.
    and point www to the same ip as your domain

    a virtual server in wls is not possible it can only listen on ip-adresses. but it should always work even with www or mail.

    thanks

    ReplyDelete
  23. Hi Edwin

    I am little bit confuse here, do we have to create WAR files for both
    1) Model controller
    2) View Controller
    if yes than do we have to specify root context same for both the deployment war profiles .

    Arshid Bhat

    ReplyDelete
  24. Hi,

    I am little bit confuse here, do we have to create WAR files for both
    1) Model controller
    2) View Controller

    No the viewcont project has a dependency with the model project so when you create a war on the view then jdev copies the code in the viewcontroler project.

    what you can do, is to make a jar deployment profile on the model project and use this deployment profile as dependency in the viewcontroller project.

    thanks

    ReplyDelete
  25. Hi Edwin. Please excuse me for me english.
    I made in my application a module for connection with my database.
    In the Defaultdomain in weblogic 10.3 this deploy perfectly. After I create other domain in this, and deploy the application but the module not connect with the database.
    Thank you for your comment

    ReplyDelete
  26. Hi Lain,

    Did you make a new datasource on the wls server and is the target of this datasource the right one.

    and check your datasource url in the am configuration this must match with the one in wls.

    Hope this helps

    ReplyDelete
  27. Thank you Edwin for your answer. But I have other question. Where is datasource URL? My module in the file weblogic-application.xml is:

    module
    name Connection1
    type JDBC
    path META-INF/Connection1-jdbc.xml

    Thank for your help.

    ReplyDelete
  28. Hi,

    I think it is located in Connection1-jdbc.xml

    Did your deploy an ear , in a war this datasource is not deployed.


    else make your own datasource. the jndi name must be jdbc/dbconnectionDS

    thanks

    ReplyDelete
  29. Thanks for sharing, It's very helpful.

    ReplyDelete
  30. Hello,

    We had an applciation running on OC4J 10G application server. Now we want to move this applciation to the 11G server.

    What should be the steps to do it?
    I created an EAR file and deployed it to the Weblogic server. it deployed successfully. How cani check the application is deployled corrected ?
    When i try to access the the Login page, it does not work ? I am new to WEBlogic and have no idea about it.please your help is required in the issues.

    thanks is advance.


    afaraz184@yahoo.com

    ReplyDelete
  31. Hi,

    it depends what you did in your webapplication. But when you use a login module you need move this to wls security realm and maybe you need to make shared libraries and configure weblogic-application.xml.

    for errors please check your domain\servers\XXXXX\logs.

    and see in deployments ( wls console ) for the status of your application deployment.

    good luck

    ReplyDelete
  32. Dear Edwin,
    I have a generic project that includes both JSF pages with backing java beans. How to deploy this project into WLS? and What is the suitable archive type that archives this project?
    Thanks in advance.

    ReplyDelete
  33. Hi,

    For a webapp you need to create a WAR deployment profile. You can do this in JDeveloper , Eclipse , ANT or maven. And you install this war in deployment.

    optional , you can add this WAR to an EAR. If you have EJB you can also include this in this EAR.

    thanks

    ReplyDelete