Common pitfalls when deploying from JDeveloper 11g to WebLogic 10.3

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

Comments:

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

Posted by Anita on November 26, 2008 at 05:22 AM PST #

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

Posted by nico on November 26, 2008 at 11:30 PM PST #

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.deploy jdbc/expertDS employeeBean ../ModelMiddleTier.deploy ../ModelCommon.deploy true weblogic simple model.emp.am.employee Sir, Can you tell me where i am wrong. Thanks Vijay Chavan

Posted by Vijay Chavan on December 04, 2008 at 06:35 PM PST #

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

Posted by Neeti Raghunath on February 04, 2009 at 11:16 PM PST #

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

Posted by shay on February 05, 2009 at 01:46 AM PST #

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 source jdbc/SQLDS javax.sql.DataSource Container 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

Posted by Neeti Raghunath on February 05, 2009 at 03:37 AM PST #

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.

Posted by shay on February 05, 2009 at 03:50 AM PST #

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 ;

Posted by rifinio on May 19, 2009 at 07:15 PM PDT #

How can you create a EAR file from the command prompt?

Posted by Sarvpreet on September 16, 2009 at 03:44 AM PDT #

Sarvpreet, you can use the ojdeploy bat file to deploy with the JDeveloper deployment profiles. Look it up in the jdev/bin directory.

Posted by shay on September 16, 2009 at 05:19 AM PDT #

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.

Posted by Ganesh on June 07, 2010 at 11:41 PM PDT #

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.

Posted by shay.shmeltzer on June 08, 2010 at 01:34 AM PDT #

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 .

Posted by Ganesh on June 08, 2010 at 11:19 PM PDT #

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

Posted by Akeem on June 14, 2010 at 12:04 AM PDT #

Thanks ur statement how to deploy the applictaion solved my problem Thanxxxxxxxxxxxxx

Posted by shubhangu on July 27, 2010 at 07:49 PM PDT #

Thanks for the tip. We were running into deployment errors until we learned from your post which level to deploy from (ear vs. war).

Posted by Steve on March 17, 2011 at 12:57 AM PDT #

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.

Posted by Joe Siczpak on April 07, 2011 at 02:56 PM PDT #

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.

Posted by shay.shmeltzer on April 08, 2011 at 03:48 AM PDT #

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?

Posted by guest on July 20, 2011 at 04:40 AM PDT #

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.

Posted by Shay on July 20, 2011 at 06:03 AM PDT #

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.

Posted by guest(sanjay) on July 21, 2011 at 06:13 AM PDT #

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

Posted by Venu Gopal on August 13, 2011 at 04:52 AM PDT #

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

Posted by chrisM on September 19, 2011 at 06:41 AM PDT #

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

Posted by Shay on September 19, 2011 at 11:23 AM PDT #

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

Posted by juddi on November 21, 2011 at 09:18 PM PST #

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

Posted by guest on November 22, 2011 at 03:25 AM PST #

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

Posted by guest on November 27, 2011 at 04:21 PM PST #

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.

Posted by Jose on February 03, 2012 at 08:47 AM PST #

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).

Posted by Shay on February 03, 2012 at 01:38 PM PST #

Hi Shay,

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

Thanks,
John

Posted by guest on April 25, 2012 at 02:06 PM PDT #

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

Posted by Ricardo Ruano on March 26, 2013 at 11:36 PM PDT #

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

Posted by Ravi Kiran on July 19, 2013 at 04:28 AM PDT #

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.

Posted by Hiroshige on September 06, 2013 at 04:39 PM PDT #

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

Posted by Shay on September 09, 2013 at 04:18 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

me
I'm a Director of Product Management for the Oracle Java Development Tools.
Follow me:
Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today