Project version in use
- Netbeans 8.0.2
- SUN JDK 64-bit: 1.7.0_71
- WEBLOGIC 12.1.3
WEBLOGIC 12.1.3 key facts
- WEBLOGIC 12.1.3 isn’t fuly Java EE 7 certified but supports the most interesting Java EE 7 specifications:
- Java Persistence API 2.1 (implemented by EclipseLink)
- JAX-RS 2.0 (implemented by Jersey)
- JSON-P 1.0 (implemented by GlassFish subproject jsonp)WebSockets 1.0 (implemented by Tyrus)
- WebLogic has also been upgraded to support Spring 3.0.x, 3.1.x, and 4.0.x.
- Netbeans 8.0.2 will show WEBLOGIC 12.1.3 certified against JEE6, JEE5 where you can create Glassfish projects with JEE7, JEE6 and JEE5 support
- For more details read: Java EE 7 and more on WebLogic 12.1.3
- Oracle White Paper: Oracle WebLogic Server 12.1.
Install WEBlogic 12.1.3
Setup OS
SELINUX status:
[root@wls1 Desktop]# sestatus
SELinux status: disabled
Firewall status:
[root@wls1 Desktop]# service iptables status
iptables: Firewall is not running.
The following actions should be performed by the "root" user.
Make sure the "/etc/hosts" file contains correct entries for both the "localhost" and real host names.
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
Create a new group and user:
# groupadd -g 54321 oinstall
# useradd -u 54321 -g oinstall oracle
# passwd oracle
Create the directories in which the Oracle software will be installed
# mkdir -p /u01/app/oracle/product/fmw12cr3
# mkdir -p /u01/app/oracle/config/domains
# mkdir -p /u01/app/oracle/config/applications
# chown -R oracle:oinstall /u01
# chmod -R 775 /u01/
Append the following entries into the "/home/oracle/.bash_profile" file.
# Adjust paths as required.
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/fmw12cr3
export MW_HOME=$ORACLE_HOME
export WLS_HOME=$MW_HOME/wlserver
export WL_HOME=$WLS_HOME
export DOMAIN_BASE=$ORACLE_BASE/config/domains
export DOMAIN_HOME=$DOMAIN_BASE/mydomain
export JAVA_HOME=/usr/java/jdk1.7.0_71
export PATH=$JAVA_HOME/bin:$PATH
Install the 64-bit Sun JDK and verify JDK version
# rpm -ivh /media/sf_kits/JAVA/jdk-7u71-linux-x64.rpm
[root@wls1 Desktop]# su - oracle
[oracle@wls1 ~]$ java -version
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
As specified in MOS Note [ID 1487773.1], amend the "/etc/security/limits.d/90-nproc.conf" file, making the following change.
# From
* soft nproc 1024
#To
* - nproc 16384
Run the installer as the "oracle" user.
[oracle@wls1 oracle]$ $JAVA_HOME/bin/java -jar /media/sf_kits/FMW/fmw_12.1.3.0.0_wls.jar
Launcher log file is /tmp/OraInstall2014-11-28_06-42-19PM/launcher2014-11-28_06-42-19PM.log.
Extracting files........................
Admin Accoung : weblogic helmut11 Port : 7001 SSL Port : 7002
Domain : wl_server
Domain Name : wl_server
Domain Location : /u01/app/oracle/product/fmw12cr3/user_projects/domains/wl_server
Application Location : /u01/app/oracle/product/fmw12cr3/user_projects/applications/wl_server
Status : Successful
Admin Server URL : http://wls1.example.com:7001/console
Domain Name : medrec
Domain Location : /u01/app/oracle/product/fmw12cr3/user_projects/domains/medrec
Application Location : /u01/app/oracle/product/fmw12cr3/user_projects/applications/medrec
Status : Successful
Admin Server URL : http://wls1.example.com:7001/console
Domain Name : medrec-spring
Domain Location : /u01/app/oracle/product/fmw12cr3/user_projects/domains/medrec-spring
Application Location : /u01/app/oracle/product/fmw12cr3/user_projects/applications/medrec-spring
Status : Successful
Admin Server URL : http://wls1.example.com:7001/console
Access
http://192.168.1.201:7001/index.jsp
WEBLOG ADMIN console : http://wls1.example.com:7001/console/login/LoginForm.jsp
Verify the Weblogic 12.1.3 setup by deploying and running the Websocket echo sample
Setting CLASSPATH and PATH for using tools like ant, ...
. $ORACLE_BASE/product/fmw12cr3/user_projects/domains/wl_server/setExamplesEnv.sh
WebSockets Key facts:
WebSockets are a new way for clients to communicate to servers and vice versa, without the overhead of an HTTP protocol
WebSockets are replacing older polling methodes ( AJAX )
Echoing Text Sent by a Client:
cd /u01/app/oracle/product/fmw12cr3/user_projects/applications/wl_server/examples/src/examples/javaee/websocket/echo
Files:
build.xml Ant build file that contains targets for building and running the example.
EchoEndpoint.java WebSocket endpoint that receives a message from a client, marks the message, and sends the message back to the client.
Client.java Standalone WebSocket client application written in the Java language.
index.html HTML page to run the browser-based Web client using JS Script/HTML
weblogic.xml WebLogic-Server-specific deployment descriptor file that sets the context root of this Web application.
Using ant to compile, deploy and run the sample
$ ant build
$ ant deploy
$ ant run.client
Run the GUI sample- Invoke the Websockets from a HTML/JAVASCRIPTS page
http://wls1.example.com:7001/sample-echo/
CONNECTED
SENT: Hello Web Sockets !
RECEIVED: onOpen is invoked.
RECEIVED: Hello Web Sockets ! (from server )
Invoke the Websockets sample from a JAVA client
[oracle@wls1 java]$ pwd
/u01/app/oracle/product/fmw12cr3/user_projects/applications/wl_server/examples/src/examples/javaee/websocket/echo/src/main/java
[oracle@wls1 java]$ javac ./org/glassfish/tyrus/sample/echo/Client.java
[oracle@wls1 java]$ java org/glassfish/tyrus/sample/echo/Client localhost:7001
Connected
SENT: hello from Java client
RECEIVED: onOpen is invoked.
RECEIVED: SENT: hello from Java client (from server)
Reference
http://www.developerfusion.com/article/143158/an-introduction-to-websockets/
Install NETBEANS 8.0.2
Verify JDK
[oracle@wls1 async]$ /usr/java/latest/bin/java -version
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
Install Netbeans 8.0.2
[root@wls1 Downloads]# ./netbeans-8.0.2-javaee-linux.sh --javahome /usr/java/jdk1.7.0_71
Installation location: /usr/local/netbeans-8.0.2
JDK for Netbeans IDE : /usr/java/latest
Add Weglogic server under Services -> Servers ( Glassfish 4.1 is pre-installed server )
Services -> Servers -> Right MB : Add server -> Oracle Weblogic Server
WLS server location: /u01/app/oracle/product/fmw12cr3/wlserver
Domain: /u01/app/oracle/product/fmw12cr3/user_projects/domains/wl_server
Details about Oracle WebLogic 12c integration with NetBeans IDE
Setup a JDBC datasource in Netbeans pointing to a RAC database
Connect to any of your RAC nodes and Learn/Verify the SCAN connect String :
[oracle@grac41 ~]$ srvctl config scan
SCAN name: grac4-scan.grid4.example.com, Network: 1/192.168.1.0/255.255.255.0/eth1
Query the local listener:
[oracle@grac41 ~]$ lsnrctl status
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
..
Service "grac4" has 1 instance(s).
Instance "grac41", status READY, has 1 handler(s) for this service...
Service "grac41" has 1 instance(s).
Instance "grac41", status READY, has 1 handler(s) for this service...
Now compose a SCAN connect string and test with sqlplus your connectivity
[oracle@grac41 ~]$ sqlplus scott/tiger@grac4-scan.grid4.example.com:1521/grac4
SQL> select host_name,instance_name from v$instance;
HOST_NAME INSTANCE_NAME
------------------------------ ----------------
grac41.example.com grac41
Test your JDBC connectivity from the RAC Node
[oracle@grac41 JDBC]$ javac version.java ( Download link )
[oracle@grac41 JDBC]$ java version jdbc:oracle:thin:@grac4-scan.grid4.example.com:1521/grac4 scott tiger
Locale: United States English
Driver Name : Oracle JDBC driver
Driver Version : 11.2.0.3.0
Driver Major Version : 11
Driver Minor Version : 2
Database Product Name : Oracle
Database Product Version: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
JVM version : 1.7.0_51
JVM vendor : Oracle Corporation
JDK version : 24.45-b08
CLASSPATH : /u01/app/oracle/product/11204/racdb/jdbc/lib/ojdbc6.jar:/home/oracle/RAC/JDBC/ucp.jar:.
LD_LIBRARY_PATH : /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
..connected
Hello JDBC: 03-DEC-14 from database GRAC4
Login to the WEBLOGIC system and verify connectivity to our RAC system:
[oracle@wls1 JDBC]$ ls /u01/app/oracle/product/fmw12cr3/oracle_common/modules/oracle.jdbc_12.1.0/
aqapi.jar ojdbc6dms.jar ojdbc6_g.jar ojdbc6.jar ojdbc7dms.jar ojdbc7_g.jar ojdbc7.jar
[oracle@wls1 JDBC]$ export CLASSPATH=.:/u01/app/oracle/product/fmw12cr3/oracle_common/modules/oracle.jdbc_12.1.0/ojdbc6.jar
[oracle@wls1 JDBC]$ javac version.java ( Download link )
[oracle@wls1 JDBC]$ java version jdbc:oracle:thin:@grac4-scan.grid4.example.com:1521/grac4 scott tiger
Locale: United States English
Driver Name : Oracle JDBC driver
Driver Version : 12.1.0.2.0
Driver Major Version : 12
Driver Minor Version : 1
Database Product Name : Oracle
Database Product Version: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
JVM version : 1.7.0_71
JVM vendor : Oracle Corporation
JDK version : 24.71-b01
CLASSPATH : .:/u01/app/oracle/product/fmw12cr3/oracle_common/modules/oracle.jdbc_12.1.0/ojdbc6.jar
LD_LIBRARY_PATH : /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
..connected
Hello JDBC: 03-DEC-14 from database GRAC4
Reference