X

Shay Shmeltzer's Oracle Development Tools Tips

Common pitfalls when deploying from JDeveloper 11g to WebLogic 10.3

Shay Shmeltzer
Director of Product Management - Oracle

One thing we should probably do in future versions of JDeveloper is work to simplify the deployment steps even further.

Don't get me wrong, we are doing a nice job now with one click packaging and deploy to a remote server - but there are still some pitfalls that people might run into.

At the end of this entry you can see a sample demo showing the basic deployment of an ADF application to a remote WebLogic Server.

The first problem most people run into is that they don't read the manual - there are quite clear instructions for deployment in the Fusion Developer Guide.

Here is a direct link to the deployment chapter.

Here are a couple of things you might run into and how to solve them.



Missing ADF libraries

If you are deploying to a stand-alone WebLogic Server - it won't have the ADF libraries on it by default. Luckily for you it is now very easy to deploy them to the server with the JDeveloper installer. You simply invoke it and choose to install to an existing WebLogic directory, and then uncheck the JDeveloper installation - it will then let you install the ADF libraries.

Then you'll be able to server's configuration wizard to add the ADF libraries to a domain.



Data-sources - and not finding them


When you are building an ADF BC application, or any other Java EE application for that matter, you should take advantage of the data-sources capabilities of your server.

In ADF BC's application module configuration it is quite easy to edit the configuration and replace the connection to be based on a JDBC DataSource instead of direct JDBC connection - once you do that the JDBC data source name will be something like: java:comp/env/jdbc/scottDS (where scott is the name of the DB connection you defined for your application).

After you did this modification, the next step is to go into the WLS admin console and define a data source. The important thing here is to have the JNDI Name be: jdbc/scottDS

This way your JDBC connection will be found.

One more common overlooked thing here is that after you define the data source in WLS you need to give it a target. So click the Targets tab and assign the datasource to the server you are going to deploy to.

One click packing from inside JDeveloper

When you create a regular Fusion application you get two projects a Model one and a ViewController one.

If you right click the ViewController one and choose deploy you'll be able to create a WAR file and directly deploy to WebLogic, but then you might run into an error message which will have this line somewhere in it:

java.lang.ClassNotFoundException: oracle.adf.library.webapp.ResourceServlet

The right way to deploy the complete application is to do it from the application level menu - where you'll find another deploy option - this will create an EAR file that will deploy successfully.

t008.gif

Ran into another gotcha? let me know in the comments and help create a knowledge base for future generation.

Here is a quick demo:

Lynn has a blog entry that walk you through the process of extending the WLS instance with the needed libraries to run ADF (installing the JRF). It also addresses the error some people are running into :

ORA-01005: null password given; logon denied

Join the discussion

Comments ( 35 )
  • Anita Wednesday, November 26, 2008
    Hi Shay,
    i succeded to deploy and run my web application (using BC and ADF Faces) to a Standalone WebLogic Server Instance started on the command line using startWebLogic.cmd.
    When I set up the Server Instance as Windows Service (following instructions http://e-docs.bea.com/wls/docs103/server_start/winservice.html) my deployed application is not started in the start up process of the WL Server. I'm not able to install/start it manually from within the Administration Console. So I tried to redeploy it from within the JDeveloper11g. But the Deployment process failed as well. [Deployer:149034]An exception occurred for task [Deployer:149026]deploy application ... on AdminServer.: .
    weblogic.management.DeploymentException:
    #### Deployment incomplete.
    I posted my problem on the Oracle WebLogic Forum as well. But nobody answered till now :-(( http://forums.oracle.com/forums/thread.jspa?threadID=830959&tstart=0
    Do you have any Idea, why the deployment works on the WLS Instance started from the Windows command line and why it failes, when it is started as a Windows Service? I changed neither the Configuration of the WL Server nor the Application Deployment.
    Thanks in advance!
    Regards Anita
  • nico Thursday, November 27, 2008
    Hi,
    how did you manage to have 2 ViewController projects. Is there something special to be cofigured to make it deployable and working with such a setup?
    Thanks
    Nico
  • Vijay Chavan Friday, December 5, 2008
    hi
    I deployed my ADF BC JSF Application on Oracle WebLogic 10.3,
    i have created Session Beans for application module
    created Datasource with name expertDS.
    bc4j.config file look like bellow,EjbWls../ModelEJB.deployjdbc/expertDSemployeeBean../ModelMiddleTier.deploy../ModelCommon.deploytrueweblogicsimplemodel.emp.am.employee
    Sir, Can you tell me where i am wrong.
    Thanks
    Vijay Chavan
  • Neeti Raghunath Thursday, February 5, 2009
    Hi Shay
    You have written about the DataSource configuration.
    "In ADF BC's application module configuration it is quite easy to edit the configuration and replace the connection to be based on a JDBC DataSource instead of direct JDBC connection "
    I want to use JNDI to connect to the database in a Struts application. Where exactly do i define the datasource? How do i find the WLS admin console?
    Thanks
    Neeti
  • shay Thursday, February 5, 2009
    Neeti,
    You can access the admin console by adding a /console to the end of your URL like this:
    http://127.0.0.1:7101/console
    Shay
  • Neeti Raghunath Thursday, February 5, 2009
    Hi Shay
    I connected to the admin console and made a datasource with
    Name = SQL
    JNDI Name = jdbc/SQLDS.
    I tested the connection and the data source and it is working out well.
    Now i want to use this datasource from my struts application. I have been connecting to the database using JDBC Connections using DriverManager. Now I want to use JNDI to connect to the database.
    I found out that the following statements have to be written in the application:
    InitialContext context = new InitialContext();
    DataSource ds = (DataSource) context.lookup("--");
    I tried putting the JNDI name "jdbc/SQLDS" as the parameter for the lookup.
    Then I put the following in the web.xml:data sourcejdbc/SQLDSjavax.sql.DataSourceContainer
    I made a database connection called SQL for the application.
    When i ran the application, it gave me the error as
    "
    javax.naming.NameNotFoundException: While trying to lookup 'jdbc.SQLDS' didn't find subcontext 'jdbc'. Resolved ''; remaining name 'jdbc/SQLDS'
    "
    I saw in an article that you can put "java:comp/env/jdbc/SQLDS" . I used that and I get a similar error that it can't find comp/env/jdbc/SQLDS.
    Can you help me out to understand what I am supposed to put for the lookup?
    Thanks
    Neeti
  • shay Thursday, February 5, 2009
    Neeti,
    Please ask these questions on the WebLogic forum on OTN - These look like generic WLS questions that don't seem to be related to JDeveloper or ADF.
  • rifinio Wednesday, May 20, 2009
    hello;
    i m a new user of the jDevoloper 11. and i'm trying to create an web Application with ADF faces.
    i used to run the application without any problems.
    but today when i tried to run it
    it gives me that error message in the log window
    --------------------------------------------------------------------------------
    http://Running application JSFApplication on Server Instance DefaultServer...
    Uploading credentials.
    ---- Deployment started. ---- May 19, 2009 11:06:08 AM
    Target platform is (Weblogic 10.3).
    Running dependency analysis...
    #### Deployment incomplete. #### May 19, 2009 11:06:08 AM
    java.lang.RuntimeException: java.lang.NullPointerException
    at oracle.jdevimpl.deploy.common.ModulePackagerImpl.deployProfiles(ModulePackagerImpl.java:88)
    at oracle.jdeveloper.deploy.common.ModulePackager.deployProfiles(ModulePackager.java:63)
    at oracle.jdeveloper.deploy.common.ModulePackager.deployImpl(ModulePackager.java:52)
    at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
    at oracle.jdevimpl.deploy.fwk.WrappedDeployer.deployImpl(WrappedDeployer.java:39)
    at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
    at oracle.jdeveloper.deploy.common.BatchDeployer.deployImpl(BatchDeployer.java:82)
    at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
    at oracle.jdevimpl.deploy.fwk.WrappedDeployer.deployImpl(WrappedDeployer.java:39)
    at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
    at oracle.jdevimpl.deploy.fwk.WrappedDeployer.deployImpl(WrappedDeployer.java:39)
    at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
    at oracle.jdeveloper.deploy.common.BatchDeployer.deployImpl(BatchDeployer.java:82)
    at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
    at oracle.jdevimpl.deploy.fwk.WrappedDeployer.deployImpl(WrappedDeployer.java:39)
    at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
    at oracle.jdeveloper.deploy.common.BatchDeployer.deployImpl(BatchDeployer.java:82)
    at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
    at oracle.jdevimpl.deploy.fwk.WrappedDeployer.deployImpl(WrappedDeployer.java:39)
    at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
    at oracle.jdeveloper.deploy.common.BatchDeployer.deployImpl(BatchDeployer.java:82)
    at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
    at oracle.jdevimpl.deploy.fwk.WrappedDeployer.deployImpl(WrappedDeployer.java:39)
    at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
    at oracle.jdevimpl.deploy.fwk.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:436)
    at oracle.jdeveloper.deploy.DeploymentManager.deploy(DeploymentManager.java:209)
    at oracle.jdevimpl.runner.adrs.AdrsStarter$5$1.run(AdrsStarter.java:1365)
    Caused by: java.lang.NullPointerException
    at oracle.ide.net.URLFileSystem$TrackedOutputStream.flush(URLFileSystem.java:2332)
    at java.io.FilterOutputStream.flush(FilterOutputStream.java:123)
    at oracle.jdevimpl.deploy.stripe.MonitoredOutputStream.flush(MonitoredOutputStream.java:84)
    at java.io.FilterOutputStream.close(FilterOutputStream.java:140)
    at oracle.jdevimpl.deploy.stripe.MonitoredOutputStream.close(MonitoredOutputStream.java:89)
    at oracle.jdevimpl.webapp.jsp.libraries.wl.WebLogicDeployerListener.prepared(WebLogicDeployerListener.java:146)
    at oracle.jdevimpl.deploy.fwk.ListenerSupport.firePrepared(ListenerSupport.java:178)
    at oracle.jdeveloper.deploy.common.AbstractDeployer.prepare(AbstractDeployer.java:78)
    at oracle.jdevimpl.deploy.fwk.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:430)
    at oracle.jdeveloper.deploy.DeploymentManager.deploy(DeploymentManager.java:209)
    at oracle.jdevimpl.deploy.common.ModulePackagerImpl.deployProfiles(ModulePackagerImpl.java:82)
    ... 26 more
    #### Cannot run application JSFApplication due to error deploying to DefaultServer.
    Application JSFApplication stopped and undeployed from Server Instance DefaultServer
    --------------------------------------------------------------------------------
    please i want some help on what to do to solve this issue :s
    thank you in advance ;
  • Sarvpreet Wednesday, September 16, 2009
    How can you create a EAR file from the command prompt?
  • shay Wednesday, September 16, 2009
    Sarvpreet, you can use the ojdeploy bat file to deploy with the JDeveloper deployment profiles.
    Look it up in the jdev/bin directory.
  • Ganesh Tuesday, June 8, 2010
    Hay Shay, i'm trying to deply the application as war file, since this ADF application has to get into our existing EAR.
    If i deploy as EAR , the deployment is successful.
    If i try to deploy as WAR, by creating model as jar and view as war with model as dependency, i'm getting "java.lang.ClassNotFoundException: oracle.jsp.runtimev2.JspServlet". The WAR file can't find the the ojsp.jar available in the server. Please let me know how to fix this.
  • shay.shmeltzer Tuesday, June 8, 2010
    Ganesh, I'm guessing that your WAR is missing some of the configuration files or entries in those files that are included in the EAR. I would suggest that you compare those between your WAR and EAR.
    (assuming you already made sure that the ADF Runtime library (JRF) is installed on your server.
  • Ganesh Wednesday, June 9, 2010
    Thanks Shay. I copied few jars to the lib of the webapp and i can deploy the application as war .
    But facing other issues like "javax.el.PropertyNotFoundException: Target Unreachable, identifier 'bindings' resolved to null".
    Trying to fix them. Will update you. Thanks .
  • Akeem Monday, June 14, 2010
    All here is what I did to get the application deployed
    1. create a deployment profile for the Model Application, this will generally be a .jar -> right click the project ->select project properties ->choose depoyment, delete the existing default profile -> click add -> you are interested in the Library Dependencies and Profile Dependencies options.
    2. Do the same for the view project making sure you select the Model as the Profile dependency for the View project
    3. you need to do the same for the application, at the application level choose application properties from the application menu, or right click the application name and choose from there
    next select deployment, delete and add new profile, select application assembly and choose the applications that will constitue the .ear file. Set other profile properties as need. Exit the profile page and Save all.
    4. Finally from the application menu, choose deploy and deploy the ear file to your desired server
    This worked for me! Thanks
  • shubhangu Wednesday, July 28, 2010
    Thanks ur statement how to deploy the applictaion solved my problem Thanxxxxxxxxxxxxx
  • Steve Thursday, March 17, 2011
    Thanks for the tip. We were running into deployment errors until we learned from your post which level to deploy from (ear vs. war).
  • Joe Siczpak Thursday, April 7, 2011
    3 work days entirely wasted due to this problem.
    Build a 2-page ADF app.
    Deployed as EAR to file system.
    In WLS 10.3.4, used the install tool on the EAR.
    Deploy appears OK.
    When running the app, it fails to start with 500 error.
    Specifically, the stack trace ends with no such method exception:
    oracle.adf.view.rich.context.UriManager.addQueryParameters.
    I am groping in the dark, and surmise that the server has an incorrect library.
    USELESS.
  • shay.shmeltzer Friday, April 8, 2011
    Joe - sorry it took that long to find the answer - but in general it is very important to have the same version of ADF libraries that you use for development on your server.
    Right now we basically have a 1 to 1 mapping between the JDev version and the supported WLS version for that reason.
  • guest Wednesday, July 20, 2011

    Hey Shay...We have a different requirement.

    Our application has one model project and couple of view controller projects. These two VC projects are independent, except that they use same model project. we are now deploying entire app as ear file. But there are times, we only change one VC not the other. So we want to deploy 2 war files individually not as single ear. Is there a way to do this?

    one way is, breaking the app into 2 apps, build model as jar and attach it to vc projects. But this need extra maintenance to model.so not a viable solution to us.

    Why cant a we deploy a war file alone? what's missing? why jdeveloper so strange? This is a basic feature in java world? we can try with our own build script to build war, if we know whats been missing?


  • Shay Wednesday, July 20, 2011

    guest - one option is to have 2 ear files each one will include the same model project but a different vc project.

    If I'm not mistaken the EAR file contains a few configuration files for the application that are outside of the model JAR or the VC WAR.


  • guest(sanjay) Thursday, July 21, 2011

    Thanks Shay, that works.

    Two ear files solved the need for now. Yes, there are some extra conf files in ear like connections, meta-inf/, adf/ etc.

    war or ear doesn't matter as long as the projects are in same workspace.


  • Venu Gopal Saturday, August 13, 2011

    Thanks Shay ! Just the solution I was looking for my deployment woes....


  • chrisM Monday, September 19, 2011

    Hey Shay, i know this is an old post, but maybe you'll see this.

    Is there a preferred method to deal with multiple data sources (each targeting a separate managed server) on a weblogic server and not having the connection being hardcoded in the ADF app?

    We have 2 db instances (QA and Dev) that share the same webserver, but the way we're doing it now, we can only deploy an ADF app to point to one of these because the jdbc data source is defined in the app.

    is there a way to have the ADF app pick a datasource based on which managed server it was deployed to?

    Thanks


  • Shay Monday, September 19, 2011

    chrisM, I haven't explored it, but I wonder if a possible solution might be a weblogic deployment plan parameter that is used instead of the hardcoded datasource URL. Somewhat similar to this: http://kingsfleet.blogspot.com/2008/12/controlling-what-service-proxy-uses-at.html


  • juddi Tuesday, November 22, 2011

    HI

    I had following errors:

    1. Caused by: java.lang.ClassNotFoundException: oracle.jsp.runtimev2.JspServlet

    2. <Warning> <oracle.adf.controller.internal.metadata.MetadataService> <CourtAdminServer><ADFc: Duplicate activity 'index' detected.> message on console.

    how to resolve it?

    thanks juddi


  • guest Tuesday, November 22, 2011

    Juddi - kind of hard to tell the answer without more information.

    For 1 it sems that you are missing some runtime libraries - so make sure you have the right version of the ADF Runtime libraries installed on your server.

    For 2 - looks like somewhere in your ADFc layer there are two entries called index - do a search for this string in your controller layer and see what you find.

    In general these type of questions are better answered on the OTN JDeveloper discussion forum


  • guest Monday, November 28, 2011

    Hi,

    I fixed it. I published about this error on http://juddi-oracle.blogspot.com/2011/11/adf-application-deployment-to-custom.html

    ojsp.jar file copy to domain library directory.

    thanks

    juddi


  • Jose Friday, February 3, 2012

    Hello Shay, thanks for your usefull tips.

    I'm trying to deploy a web application, seen on this tutorial:

    http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/adfmobile/ShermanNewFeatiure-ADFMobileBrowser.html

    but I'm getting the ERROR: No Java EE modules detected in EAR archive. I have searched for a solution to this problem and I found out that I have to select JEE module in the Deployment Profile/ Application Assembly, but in my case when I expand my .jpr file no module with check box appears. There is any workaround to this problem?

    Regards,

    Jose.


  • Shay Friday, February 3, 2012

    Jose - can you try and see if creating a WAR file from the view project (after defining dependencies on the model project) is good enough in the case of this type of application? (First verify that you can run your pages in the embedded WLS).


  • guest Wednesday, April 25, 2012

    Hi Shay,

    Does JDeveloper has an ability to deploy an application directly into a Weblogic cluster, instead of a single server?

    Thanks,

    John


  • Ricardo Ruano Wednesday, March 27, 2013

    hi, here I include the solution that synthesizes several scenarios for this error to deploy adf application

    http://rickymax.wordpress.com/2013/03/27/adf-application-deployment-errors/

    bye and regards from ecuador


  • Ravi Kiran Friday, July 19, 2013

    Hi Shay

    This really helped me solve my problem, I was trying to deploy the .war file and getting the ClassNotFound exception. Deploying the .ear file has done it.

    Thanks for the post.

    I'm encountering another problem

    I'm trying to deploy application from Jdev to a remote WLS

    I could establish the connection in Resource Pallette properly, tested it.

    During deployment, I'm selecting the connection, its showing the server details as well, but when I say finish, it is giving me the following Exception

    Note: This is a BPM app, but getting a similar error for ADF apps too

    Server is most likely down. Please check the server status and make sure it is up.

    Error deploying archive sca_PrjInitiation_Sample_2_rev1.0.jar to partition "BPM_P6" on server AdminServer [http://192.168.1.60:7600]

    HTTP error code returned [-1]

    No error message is returned from the server.

    Error deploying archive sca_PrjInitiation_Sample_2_rev1.0.jar to partition "BPM_P6" on server AdminServer [http://192.168.1.60:7600]

    #### Deployment incomplete. ####

    Error deploying archive file:/C:/JDeveloper/mywork/SampleInitiationApp/PrjInitiation_Sample_2/deploy/sca_PrjInitiation_Sample_2_rev1.0.jar

    (oracle.tip.tools.ide.fabric.deploy.common.SOARemoteDeployer)

    Now, it says server is down, but not really.

    The same files, If I deploy directly from EM, they are getting deployed properly.

    Would you please help me in this regard

    Regards

    RaviKiran


  • Hiroshige Friday, September 6, 2013

    Hi, I´m newbie with ADF. I was trying with this tutorial http://www.oracle.com/webfolder/technetwork/tutorials/obe/jdev/obe11jdev/ps1/ria_application/developriaapplication_long.htm#ab, I do two or three times but when I try the step to deploy throws me this: Caused by: java.lang.ClassNotFoundException: oracle.adf.library.webapp.ResourceServlet

    Can you help me ?

    Thanks.


  • Shay Monday, September 9, 2013

    Hiroshige - I'm not sure which JDev version you are using but these tutorials usually work out of the box. I would recommend that you post these type of questions on the OTN JDeveloper forum


  • guest Wednesday, October 21, 2015

    Hi, I was trying a POC with Human workflow in 11g. I could create BPEL process and the work flow, careted form and while deploying attached the form project. But during deployment, am getting the following error:

    [06:16:16 PM] Weblogic Server Exception: weblogic.application.ModuleException:

    [06:16:16 PM] Caused by: java.lang.NoClassDefFoundError: oracle/jdevimpl/webapp/taglib/metadata/MetadataItemNames

    [06:16:16 PM] See server logs or server console for more details.

    [06:16:16 PM] weblogic.application.ModuleException:

    [06:16:16 PM] Taskflow deployment failed to deploy to server. oracle.jdeveloper.deploy.DeployException: Remote deployment failed

    [06:16:16 PM] #### Deployment incomplete. ####

    [06:16:16 PM] Remote deployment failed

    Can u provide your suggestion on where I am going wrong


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.