Search This Blog

Showing posts with label FMW 11g. Show all posts
Showing posts with label FMW 11g. Show all posts

Tuesday, 2 November 2010

Connecting to WLS 11g MBeanServer using jconsole on a windows client

Viewing the MBeans available in WLS 11g from the client side with jconsole is done as follows. The key here is to create the necessary client side JAR file required to access WLS 11g using JMX. In this example we are using JDK 1.6.

Note: The steps for JDK 1.5 are NOT identical to these.

1. First create a wlfullclient.jar with steps as follows on the WLS server. This will give you what you need on the client side to connect to WLS MBean Server.

- Change directories to the server/lib directory.

cd WL_HOME/server/lib

- Use the following command to create wlfullclient.jar in the server/lib directory:

java -jar wljarbuilder.jar

2. Now add/provide wlfullclient.jar to the classpath for jconsole on the client side as follows.

jconsole -J-Djava.class.path=wlfullclient.jar;C:\jdev\jdk\jdk1.6.0_21\lib\jconsole.jar -J-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote

3. Jconsole should display requesting you to provide the remote server you wish to connect to. In this example I am simply going to connect to the RUNTIME MBean Sever with connect details as follows for the "Remote Process" field. Also I have to add a username/password for the WLS 11g server in order to connect.

service:jmx:iiop://wayne-p2.au.oracle.com:7003/jndi/weblogic.management.mbeanservers.runtime


4. Press the connect button and now you can easily see which MBeans you wish to view.


For more information on the MBeans in WLS 11g refer to this URL.

http://download.oracle.com/docs/cd/E14571_01/apirefs.1111/e13951/core/index.html

Wednesday, 5 May 2010

Installing ADF runtime into FMW 11gR1 patchset 2

If you wish to use ADF with FMW 11gR1 pathset 2 (11.1.1.3) you will need to install it as follows into your stand alone FMW home.

Note: Assuming you already have Weblogic 10.3.3 installed.

1. Navigate to this web page which is where we need to download some files from.

http://www.oracle.com/technology/software/products/middleware/htdocs/fmw_11_download.html

2. Download and install "Application Development Runtime (11.1.1.2.0)" into your stand alone Weblogic 10.3.3

3. Now download and install "Application Development Runtime (11.1.1.3.0)" into your stand alone Weblogic 10.3.3.

4. Now run config.sh to create a new domain for ADF applications. I normally select "Oracle Enterprise Manager" which will then include the JRF required for ADF, as shown below.
















5. Then in EM itself apply the JRF template to the managed servers which will host ADF applications developed in JDeveloper 11.1.1.3.

- http://{server}:{port}/em
- Click the + symbol for "Weblogic Domain".
- Click on the + symbol for your domain.
- Select the managed server you wish to enable ADF applications for.
- Click on the button "Apply JRF Template".

6. Finally deploy an ADF app from JDeveloper 11.1.1.3 to verify the setup.

[09:22:08 AM] ---- Deployment started. ----
[09:22:08 AM] Target platform is (Weblogic 10.3).
[09:22:08 AM] Retrieving existing application information
[09:22:09 AM] Running dependency analysis...
[09:22:09 AM] Building...
[09:22:19 AM] Deploying 2 profiles...
[09:22:23 AM] Wrote Web Application Module to D:\jdev\jdevprod\11gr3\jdeveloper\jdev\mywork\ADFDemo\ViewController\deploy\ADFDemo_ViewController_webapp1.war
[09:22:25 AM] Wrote Enterprise Application Module to D:\jdev\jdevprod\11gr3\jdeveloper\jdev\mywork\ADFDemo\deploy\ADFDemo_application1.ear
[09:22:26 AM] Deploying Application...
[09:22:29 AM] [Deployer:149191]Operation 'deploy' on application 'ADFDemo_application1' is initializing on 'apple'
[09:22:36 AM] [Deployer:149192]Operation 'deploy' on application 'ADFDemo_application1' is in progress on 'apple'
[09:22:47 AM] [Deployer:149194]Operation 'deploy' on application 'ADFDemo_application1' has succeeded on 'apple'
[09:22:47 AM] Application Deployed Successfully.
[09:22:47 AM] The following URL context root(s) were defined and can be used as a starting point to test your application:
[09:22:47 AM] http://10.187.81.36:7003/adfdemo
[09:22:47 AM] Elapsed time for deployment: 39 seconds
[09:22:47 AM] ---- Deployment finished. ----

Thursday, 25 February 2010

Accessing a Data Source Remotely in FMW 11g (11.1.1.2.0) from JDeveloper 11g (11.1.1.2.0)

I needed to access a data source remotely on FMW 11g server from JDeveloper 11g. I found that to do this I needed to follow these steps.

Note: This was done using 11.1.1.2 which is the latest version of FMW 11g and JDeveloper 11g

1. Edit setDomainEnv script to ensure you set this property to true. By default it's false.

WLS_JDBC_REMOTE_ENABLED="-Dweblogic.jdbc.remoteEnabled=true"

2. Re-start your server to pick up the change done at step #1 above.

3. In your project add the following libraries to allow remote access and the required JDBC driver library.
  • Weblogic 10.3 Remote-Client
  • Oracle JDBC
4. From JDeveloper access your data source remotely with code as follows making sure you use your connection details and the correct JNDI name for the data source.


package pas.au.remote.wls11g;

import java.sql.Connection;

import java.sql.SQLException;

import java.util.Date;
import java.util.Hashtable;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import javax.sql.DataSource;

public class RemoteDataSourceAccess
{
private Logger logger = Logger.getLogger(this.getClass().getSimpleName());
public RemoteDataSourceAccess()
{
}

public void run ()
{
logger.log(Level.INFO, "Started RemoteDataSourceAccess at " + new Date());

InitialContext ctx = null;

try
{
ctx = getInitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/scottDS");
Connection conn = (Connection) ds.getConnection();
logger.log(Level.INFO, "Got connection : " + conn);

logger.log(Level.INFO, "Auto Commit = " + conn.getAutoCommit());
}
catch (NamingException e)
{
logger.log(Level.SEVERE, "Error occurred", e);
System.exit(1);
}
catch (SQLException e)
{
logger.log(Level.SEVERE, "SQLException occurred", e);
System.exit(1);
}

logger.log(Level.INFO, "Ended RemoteDataSourceAccess at " + new Date());
}

public static InitialContext getInitialContext() throws NamingException
{
String JNDI_FACTORY="weblogic.jndi.WLInitialContextFactory";
String url = "t3://wayne-p2.au.oracle.com:7003";
String username = "weblogic";
String password = "welcome1";

Hashtable<String,String> env = new Hashtable<String,String>();
env.put(Context.SECURITY_PRINCIPAL, username);
env.put(Context.SECURITY_CREDENTIALS, password);
env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
env.put(Context.PROVIDER_URL, url);
return new InitialContext(env);
}

public static void main(String[] args)
{

RemoteDataSourceAccess test = new RemoteDataSourceAccess();
test.run();
}
}

5. Output as follows.

25/02/2010 9:22:56 AM pas.au.remote.wls11g.RemoteDataSourceAccess run
INFO: Started RemoteDataSourceAccess at Thu Feb 25 09:22:56 EST 2010
25/02/2010 9:23:03 AM pas.au.remote.wls11g.RemoteDataSourceAccess run
INFO: Got connection : weblogic.jdbc.rmi.SerialConnection_weblogic_jdbc_rmi_internal_ConnectionImpl_weblogic_jdbc_wrapper_PoolConnection_oracle_jdbc_driver_T4CConnection_1032_WLStub@1
25/02/2010 9:23:03 AM pas.au.remote.wls11g.RemoteDataSourceAccess run
INFO: Auto Commit = true
25/02/2010 9:23:03 AM pas.au.remote.wls11g.RemoteDataSourceAccess run
INFO: Ended RemoteDataSourceAccess at Thu Feb 25 09:23:03 EST 2010

Thursday, 30 July 2009

OFM 11g r1 Web Tier Utilities to enable OHS front end

My previous post "Installing the ADF Runtime on Oracle Fusion Middleware 11gR1" showed that using the "Application Development Runtime" we can enable FMW control (EM) and hence enable our managed servers to deploy/run ADF 11g applications.

The last install you may want to consider is the "Web Tier Utilities" which gives you the ability to front end our managed servers with OHS which is OPMN managed Apache HTTP server.

http://www.oracle.com/technology/software/products/middleware/htdocs/111110_fmw.html
Web Tier Utilities

This will allow OHS instance to act as a proxy server to the cluster and as a result of doing this you can use FMW Control to managed your domain and the OHS instance.

Once you have installed this you will run the configure wizard as follows on windows

Oracle Web Tier – Home1 -> Configure Web Tier Instance

Make sure you select the correct Weblogic admin server you wish to front end here.

The final piece here is to ensure you then configure the OHS instance to act as a proxy server to the WebLogic cluster. You do this from FMW Control itself, by right-clicking on the OHS instance and selecting Ports Configuration and mod_wl_ohs Configuration from the Administration menu. Essentially it is doing the update of mod_wl_ohs.conf for you so you don't have to manally edit that file. here is an example of what that file looks like once your done.

<IfModule weblogic_module>
WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005
DynamicServerList Off
MatchExpression /*
</IfModule>