Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12c
-
date post
18-Oct-2014 -
Category
Technology
-
view
7.562 -
download
0
description
Transcript of Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12c
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Developing Java EE Applications for WebLogic 12c with IntelliJ IDEA
Bruno Borges Principal Product Manager Oracle Latin America June, 2014
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
3
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Program Agenda
Oracle WebLogic 12c Overview
Installationand Configuration
IntelliJ IDEA Configuration
Developing Java EE Applications
Q&A
1
2
3
4
5
4
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Oracle WebLogic 12c Overview
5
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
WebLogic & Coherence Delivery Platforms and Focus Areas
Oracle Cloud Application Foundation S
tra
teg
ic
Fo
cu
s
Multitenancy for Density/Utilization
#1 HIGH PRODUCTIVITY
Java EE
Java SE
HTML5
Mobile, Developer Productivity
Cloud Scale Management
and Operations High Availability and
Performance
Engineered Systems (Exalogic, SuperCluster) Conventional On-premise Public, Private, 3rd Party Cloud
Pla
tfo
rm
Ch
oic
e
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Oracle Cloud On Premise Private Cloud
3rd Party Public Cloud
DEPLOY ANYWHERE
Architectural Flexibility By Design
Cloud Application Foundation
On Conventional Systems with any
Virtualization
On Oracle Engineered Systems
Developer Service
Java Cloud Services
Database Cloud Service
Compute Service
Storage Service
Messaging Service
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Just hours to a best-of-breed HA Web virtualized application and database infrastructure
Simplified Provisioning
Integrated patching
Simplified Maintenance
Capacity on Demand with pricing that scales economically to your workload changes
Simplified Investment
With Oracle Database Appliance and WebLogic
On Premise Private Clouds
ORACLE DATABASE RAC
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
• Lowest response time
• Highest throughput
• Most Efficient Solution
Performance
• Engineered product
• Platinum Support
• Most Reliable Solution
Lower Risk
• App-to-disk Management
• Optimized lifecycle
• Ease of Setup, Operation
Integrated Management
• Virtual compute available on Demand through Self-Serve
• Agility
Scalable
With Engineered Systems: Oracle Exalogic Elastic Cloud
On Premise Private Clouds
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Exalogic: Best System to Run WebLogic Server
9.4X
WEBLOGIC SERVER VS. COMMERCIAL COTS VIRTUAL VS. EXALOGIC VIRTUAL
24X
WEBLOGIC SERVER VS. OSS
26X
OSS Java EE Container
WebLogic Server/
Exalogic Bare Metal
Commercial Java EE Container
WebLogic Server/
Exalogic Bare Metal
WebLogic Server/
Exalogic Virtual
OSS Java EE Container/
COTS Virtual
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
On 3rd-party Cloud Providers
Oracle Database 12c
WebLogic Server
Java Applications
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Try it now! – cloud.oracle.com
Oracle Java Cloud Service
• Rapid time to market for Oracle SaaS applications extensions
• Each tenant gets dedicated WebLogic cluster
• Built-in integration to Storage, Messaging and Developer Services
• Fully managed service
• Application Development:
– JDeveloper, Eclipse, NetBeans, IntelliJ, Maven
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Dynamic Clusters Simplified, Scalable, Cloud-ready
13
• Zero Reconfiguration to Scale, Shrink Clusters
• Dynamic Clusters with Automated Ports, Naming
• Oracle Cloud, Private Cloud Elasticity
Usability and
Scalability Dynamic Clusters
JMS
JMS
JMS
JMS
JMS
JMS
JMS
JMS
JMS
JMS
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Manageability Java Mission Control and WebLogic Diagnostic Framework
14
Capability Oracle JRockit JDK6 (R28+)
Oracle JDK 7u4+ Oracle JDK
7u40+
Host JRMC/JMC GUI Y - JRMC Y - JMC Y - JMC
Binaries with JMC GUI
Default Download Special binary
on MOS Default
Download
WLDF JFR events and analysis
Y Y Y
JFR, JMC convergence –
JVM events Y N Y
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Database Integration Oracle WebLogic Server 12c, Oracle Database 12c
15
Availability, Multitenancy,
Scalabiity
• Application Availability with Transaction Guard
• Support for Multi-Tenant Database
• Scalability with Connection Pooling
Application Continuity
Database Resident
Connection Pool
Global Data Services
Multi-Tenant
Database
WebLogic Server
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Oracle WebLogic: Guaranteed High Availability
• Newer version of application deployed side-by-side with older version in same JVM
• Clients already connected continued to be served by older version
• New clients connect to newer version
• Test versions before opening up to users
• Rollback to previous versions
• Automatic retirement – graceful or timeout
Example: Zero Down Time Application Deployment
Managed WebLogic Server Single Java VM
Existing Client Connections New Client Connections
New Application Version Retiring Application Version
Administrative Test Client Connections
Test First in Administrative
Mode
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Developer Tools and Technologies
17
Java Cloud Service
Classloader Analysis Tool
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Repository
Product JARs POMs <project> <groupId>com.oracle.weblogic</groupId> <artifactId>webservices</artifactId> <version>12.1.2</version> <packaging>jar</packaging> </project>
Archetypes
Sync plugin
WebLogic plugin
WebLogic Server 12c Maven Updates
18
• One goal in 11g to full lifecycle in 12c
• Local install in 11g to repository in 12c
• Patching strategy for jar updates in 12c
• OOTB Maven bundling
• Archetypes
• Comprehensive docs
• FMW-wide strategy
• appc
• create-domain
• Deploy
• distribute-app
• Install
• list-apps
• Redeploy
• start-app
• start-server
• stop-app
• stop-server
• undeploy
• uninstall
• update-app
• wlst
• ws-clientgen
• ws-wsdlc
• ws-jwsc
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Installation and Configuration
19
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
WebLogic 12.1.2 and beyond
• Unified installation process across all Oracle product stack with OUI
• Unified patching process with OPatch
20
Oracle Universal Installer
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Lightweight Development with WebLogic Server
• Download size improvement for developers
• No installer, unzip and go on Win/Linux/OSX
• Start an instance with -Dservertype=wlx to launch without EJB, JMS, and JCA containers
• FastSwap greatly reduces project redeployment requirement when doing iterative deployment
190mb
318mb
1GB
11g Full Distro 11g Zip Distro 12c Zip Distro
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Demo: Installing WLS 12c ZIP distro
• Unzip the ZIP file
• Go to the extracted folder using your terminal
• Make sure JAVA_HOME points to a Oracle JDK 1.7 installation directory
• Execute the configure utility – Windows: configure.cmd
– Unix (Mac/Linux): configure.sh
• By the end, it will ask you if you want to create a domain. Say ‘Y’.
• Provide a username and password of your choice
• WebLogic will then start and be accessible from http://localhost:7001/console
22
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
IntelliJ IDEA
23
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
IntelliJ IDEA
• IntelliJ IDEA Ultimate is the full-featured edition
• Comes with J2EE 1.4, Java EE 5, Java EE 6 and 7 support
– Includes JSF support
– Includes JSF components libraries support (e.g: PrimeFaces)
• Web Development for other frameworks – Spring MVC, GWT, Vaadin, Play, Grails
• Database Development Tools, UML Designer, Build Tools, JVM languages
• And many other features
24
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Configuring WebLogic 12c
1. During install, make sure you select WebLogic support feature
2. Open IntelliJ IDEA
3. Select “Configure”
4. Select “Settings”
5. Filter for “Application Servers” on top left
6. Click on + icon
7. Select WebLogic Server
8. Type the WebLogic Home. 1. Example (Windows) – D:\wls12130
25
Getting ready to develop Java EE applications for WebLogic with IntelliJ
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Configuring the Apache Maven Plugin for WebLogic 12c
• Go to the WebLogic Home installation directory. – Example: D:\wls12130
• Go to oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/12.1.3/
• Execute the following command: $ mvn install:install-file -DpomFile=oracle-maven-sync-12.1.3.pom -Dfile=oracle-maven-
sync-12.1.3.jar
• Execute last command: $ mvn com.oracle.maven:oracle-maven-sync:push -Doracle-maven-
sync.oracleHome=d:\wls12130\
26
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Creating a Web project from WebLogic Maven Archetype
$ mvn archetype:generate -DarchetypeGroupId=com.oracle.weblogic.archetype -DarchetypeArtifactId=basic-webapp -DarchetypeVersion=12.1.3-0-0 -DgroupId=org.mycompany -DartifactId=my-basic-webapp-project -Dversion=1.0-SNAPSHOT
• Open this Maven project on IntelliJ by choosing “Open project”, then select the pom.xml file
27
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Developing Java EE Applications
28
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Developer APIs – Java EE 6
29
• WebLogic 12.1.1 completed WebLogic Java EE 6 API support
– Servlet 3.0, CDI, Managed Beans, JSP 2.2, EJB 3.1, JAX-WS 2.2
– JAX-RS 1.1, JPA 2.0, JSF 2.0 available in WLS 10.3.4+
• Java EE 6 Makes Development Faster
– Fewer Java Classes, Less Code, Less XML
• With Modern Programming Techniques
– Dependency Injection, Annotations, POJO, REST
Lines of Code* Lines of XML* Java Classes*
25% Less
50% Less
80% Less
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
ADF 12c New Layout Components
• Springboard
• Drawer
• GridLayout
New components
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
New ADF Faces Data Visualization Components
• Sunburst
• TimeLine
• Treemap
• New Skin
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
New ADF Faces Components
• Listview
• Paging table
• Code editor
• Multi-file upload
More components
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
TopLink Data Services
• Problem: Simplify access to enterprise data sources
• Solution: Auto-generate RESTful interfaces to enterprise data
• Benefit: Client data access and notifications with no server programming
Provide Enterprise Data Access with no Server-Side programming
WebLogic Server
JPA
Clients
HTTP/S JSON/XML
Change Notification
Database
Stand
ard clie
nts: H
TML5
, R
EST, JSON
/XM
L
ADF Mobile
TopLink Data Services
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Oracle TopLink Data Services
Query Example
$.ajax({
url: 'persistence/v1.0/auction/query/User.all',
type: "GET",
timeout: 2000,
success: function(users) {
my_js_app.showUsers(users);
},
error : function(message) {
console.log("Could not retrieve the list of users”);
}
});
Persistence Unit
Named Query
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
TopLink Data Services in 12c
• Easy to configure JSON/XML access via REST to enterprise data sources
• Declarative: No Java SE/EE development required – Existing JPA apps
• Add TopLink Data Services web fragment to app • Upon deployment, REST interfaces to entities generated using JAX-RS
– Can also generate mapping file from DB, and expose interfaces based on that
– Supports Oracle DB Notifications
• Multiple Data Sources: Relational, NoSQL, Coherence
• Multiple Clients: HTML5/JS, mobile devices, ADF Mobile
• Leverage all of TopLink’s features including TopLink Grid, etc.
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Java EE: Today and into the Future
Java EE 7 Developer Productivity & HTML5
2013 - Future 1998-2004
Enterprise
Java Platform
Robustness
Web Services
2005-2012
Ease of
Development
Lightweight
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
WebLogic 12.1.3 – Developer APIs Providing Support for Mobile and Rich Applications
37
WLS 12.1.3 Clients
HTM
L5
clien
ts
ADF Mobile
Proxies
OTD
Apache
OHS
Web Sockets (JSR 356)
TopLink Data Services
Server-Sent Events
JAX-RS 2.0
WebSocket Emulation
We
bSo
cket Em
ulatio
n
JAX-RS 2.0, WebSocket 1.0
JSON Programming API
JPA 2.1
Server-Sent Events
WebSocket Emulation
JPA-RS
JPA
Change Notification
Database
JSON Programming API
HTTP/S, JSON/XML WebSocket, Server-Sent
Events, Long polling
Java EE 7 APIs
Additional WebLogic Value-Add
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 39