SlideShare une entreprise Scribd logo
1  sur  51
MYFACES CODI AND JBOSS SEAM3
BECOME APACHE DELTASPIKE
Apache MyFaces CODI is …

• … a portable CDI extension
    (no CDI implementation)
• … compatible with Java-EE5+
• … tested on most major servers
• … easy to use and extensible
• … very fast and stable
• … one "part" of Apache DeltaSpike
• … one of few popular CDI extensions
• … optimized for large applications
• … developed by an open community
History of MyFaces CODI

• Apache MyFaces Orchestra introduced
  interesting concepts in combination with
  Spring
• 12-2009 CDI 1.0
• 2-2010 MyFaces ExtCDI (aka CODI) started
• 11-2010 first stable release (6 modules)
• 7-2011 release of v1.0.0
  (formal step - CODI was very stable already)
Setup MyFaces CODI for Servlet Containers

• Add the CDI implementation of your choice
• Add MyFaces CODI to the project
  – With Maven
     • Add the modules (or the all-in-one bundle) to the POM
  – Without Maven
     • Download the current version of CODI
     • Add the modules (or the all-in-one bundle) to the
       Classpath of the project
• Start using it!
Webapp Setup by Example with Maven - 1

• The easy way:

 Add the all-in-one bundle for the version of
 JSF you are using (1.2.x or 2.x)

 Example for JSF 2.x
 <dependency>
   <groupId>org.apache.myfaces.extensions.cdi.bundles</groupId>
   <artifactId>myfaces-extcdi-bundle-jsf20</artifactId>
   <version>1.0.5</version>
   <scope>compile</scope>
 </dependency>
Webapp Setup by Example with Maven - 2

• An alternative:

  Generate a template project
  mvn archetype:generate -DarchetypeCatalog=
  http://myfaces.apache.org
  Example for JSF 2.x
Webapp Setup by Example without Maven

• Download the binary distribution which
  contains all modules:
  http://s.apache.org/myfaces_binaries/
  -> e.g.:
   myfaces-extcdi-assembly-jsf20-1.0.5-bin.zip
  or the all-in-one bundle:
  http://s.apache.org/codi_mvn_bundles
  -> e.g.:
  myfaces-extcdi-bundle-jsf20/1.0.5/
   myfaces-extcdi-bundle-jsf20-1.0.5.jar
• Add the JAR(s) of your choice to /WEB-INF/lib
MyFaces CODI Modules - Overview - 1

•   Core
•   JSF Module (for 1.2 and 2.x)
•   JPA Module
•   BV Module
•   I18N-Message Module
•   Scripting Module
MyFaces CODI Modules - Overview - 2

•   Trinidad Support Module (for 1.x and 2.x)
•   Java-EE5 Support Module
•   Bundles (+ OSGi Bundles)
•   Test Modules
•   Alternative Config and Impl Modules
MyFaces CODI – TOP 10 (unordered)

• Type-safe and extensible Project-Stages
• Conditional bean activation
• Scopes
• Type-safe View-Config and Navigation
                                            Workshop
• Type-safe CODI-Config                     examples
• View-Controller
• Extensibility
  (Security, Interceptors, Factories, …)
• Advanced I18n
• Transactional beans without EJBs
• Configurable JPA DataSource
Symbols


 DS
      … Same concept used for DeltaSpike

 DS
      … Similar concept used for DeltaSpike
 DS
      … Concept planned for DeltaSpike
Type-safe and extensible Project-Stages

                                               DS
• … with Java-EE6
  – Only available in JSF
  – Not type-safe
  – Not extensible
• … with MyFaces CODI
  – Available for all CDI based applications
  – Type-safe
  – Extensible
Project-Stages Configuration by Example

• Configuration
  – Not in the deployable archive (e.g. web.xml)
  – Via build- or container-configuration
  – Useful e.g. in combination with maven profiles
• Example with Jetty (+ Maven3)
  <configuration>
       <systemProperties>
                <systemProperty>
                        <name>faces.PROJECT_STAGE</name>
                        <value>Development</value>
                </systemProperty>
       </systemProperties>
  </configuration>
Conditional Bean Activation

                                            DS
• … with Java-EE6
  – Not out-of-the-box
    (Manually via a CDI-Extension
     and ProcessAnnotatedType#veto)
• … with MyFaces CODI
  – @ProjectStageActivated
    (supports also custom project-stages)
  – @ExpressionActivated
    (+ customizable expression syntax)
@ProjectStageActivated by Example

@Alternative //+ config in beans.xml
@ProjectStageActivated(ProjectStage.Production.class)
public class ProductionCodiCoreConfig extends CodiCoreConfig
{
  @Override
  public boolean isConfigurationLoggingEnabled()
  {
    return false;
  }
}
Scopes

• … with std. CDI and JSF
  (JSF Scopes not integrated       )
  – Request-, Session-, Application-Scope
  – View-, Flash-, Custom-, None-Scope (JSF)
  – Conversation-, Dependent, Singleton-Scope (CDI)
• … with MyFaces CODI
  – Autom. converts JSF beans to CDI beans                DS
  – Window-, (Grouped-)Conversation-,
    ViewAccess-, Rest-Scope (for CDI + JSF)
  – Transaction-Scope (for CDI)               Different types of
                                                conversations
CODI Scopes by Example - Window-Scope

• Without MyFaces CODI – e.g.:
  @SessionScoped
  public class MyBean implements Serializable
  {
    //…
  }

  -> multiple Browser-Tabs use the same instances
• With MyFaces CODI – e.g.:
  @WindowScoped
  public class MyBean implements Serializable
  {
    //…
  }
Destroy MyFaces CODI Conversations

• Close a conversation
  @Inject
  private Conversation conversation;

  this.conversation.close();

• Use the Window-Context
  @Inject
  private WindowContext windowContext;

  this.windowContext.close(); //and #close*
Type-safe View-Config

• … with std. JSF
  – Not available
• … with MyFaces CODI             DS
  – Type-safe navigation
  – View-Controller, Security,…
  – Meta-data inheritance
  – Custom meta-data
  – Checked target regions
Type-safe View-Config by Example – 1

• Allow to
  –   host meta-data for pages
  –   structure pages
  –   navigate in a type-safe way
  –   inherit meta-data
• Inline usage at page-beans is possible
• Example for index.xhtml
  @Page
  public class Index implements ViewConfig {}
Type-safe View-Config by Example – 2

• POST-Requests
  <h:commandButton … action="#{myPageController.next}"/>
  public Class<? extends ViewConfig> next() {
    //Pages extends ViewConfig, Index implements Pages
    return Pages.Index.class;
  }
• GET-Requests
  <h:link ... outcome="#{myPageController.nextPage}"/>
  public Class<? extends Pages> getNextPage() {
    //Pages extends ViewConfig, Index implements Pages
    return Pages.Index.class;
  }
Type-safe View-Config - Advanced

• http://s.apache.org/make-jsf-more-typesafe
  – View-Controller Annotations
  – Integration with @Secured
  – Default Error-View
  – Easy manual navigation via ViewNavigationHandler
  – Observe a pre-navigation event
    (navigation target can be changed)
  – Custom Meta-data
  –…
MYFACES CODI - A QUICK TOUR
Migrating the example

FROM SERVLET CONTAINER
TO APPLICATION SERVER
Migration to Java-EE6+ Application Server

• General steps for all servers:
  – Java-EE dependencies are provided by the server
    (-> don’t deploy them)
  – Remove the CDI listener (web.xml)
Migration to Oracle GlassFish 3.1.x

•   Java-EE6 reference implementation
•   CDI Implementation: JBoss Weld
•   Use version 3.1.2+ if possible (at least v3.1.1)
•   Needed changes:
    – Std. changes for Java-EE6+
    – See BDA hints esp. for GlassFish < v3.1.2
Migration to IBM WebSphere 8

•   First WAS version which implements Java-EE6
•   CDI Implementation: OpenWebBeans (with BDA)
•   Use version 8.0.0.1+
•   Needed changes:
    – Std. changes for Java-EE6+
    – See BDA hints
      (OpenWebBeans is used in BDA mode)
Migration to JBoss-AS7

• JBoss Application Server
  (implemented from scratch)
• Since 7.1 Java-EE6 full profile
• CDI Implementation: JBoss Weld
• Needed changes:
  – Std. changes for Java-EE6+
  – See BDA hints
Migration to Oracle Weblogic 12c (R1)

• First WLS version which implements Java-EE6
• CDI Implementation: JBoss Weld 1.1.3_SP1
• Needed changes:
  – Std. changes for Java-EE6+
  – See BDA hints
  – Use the all-in-one bundle of MyFaces CODI 1.0.5+
Migration to Apache TomEE v1

• TomEE is based on a std. Tomcat
  – Java-EE6 Web-Profile
    CDI, EJB, JPA, JSF, JSP, JSTL, JTA, Servlet, JavaMail,
    Bean Validation
  – TomEE+ adds JAX-RS, JAX-WS, JMS, Connectors
• CDI Implementation: Apache OpenWebBeans
• Needed changes:
  – Std. changes for Java-EE6+ -> That’s it
Using MyFaces CODI with …

• A list of tested servers and frameworks:
  http://s.apache.org/CODI_Compatibility
Common Pitfalls – Bootstrapping order

• Java-EE6 servers usually start CDI before JSF
• Not all servers have a deterministic order
• Sometimes it depends on the version – e.g.:
  Jetty6 vs Jetty7 (vs Jetty8)
• Exception:
  IllegalStateException: no […]BeanManagerProvider in place!
  Please ensure that you configured the CDI implementation of your choice
  properly. If your setup is correct, please clear all caches and compiled artifacts.
  If there is still a problem, try one of the controlled bootstrapping add-ons for
  the CDI implementation you are using.
• Solutions:
   – The exception provides the details already
   – Another exception occurred before -> fix it
Common Pitfalls – Cross-BDAs issues

• Bean deployment archives
  The implementation depends on the interpretation of the
  specification
• Spec. issues: CDI-18, CDI-112
   – A strict implementation restricts various artifacts to the same
     bean archive
   – A misinterpretation or bug can break applications easily
     E.g.: @Alternative annotated beans are only valid
     for the same archive
     -> breaks a lot of use-cases
     -> OWB (standalone) ignores this rule by default
• Implementation issues:
   – Several versions of Weld < v1.1.4 are broken e.g. regarding
     @Specialize WELD-912, WELD-974,…
Common Pitfalls – BDAs (of CDI 1.0) - 1

• Exceptions
   – Enabled interceptor class SecurityInterceptor is
     neither annotated @Interceptor nor registered
     through a portable extension
   – No bean found for type: [CODI class]
   – Unsatisfied dependencies for type [CODI class]
• Solutions (steps):




                                                        step until it works
   1.   Use the all-in-one package of MyFaces CODI




                                                         Follow it step by
   2.   Copy the content of beans.xml to
        the beans.xml of the application
   3.   The version of the CDI implementation
        is utterly broken -> upgrade it
Common Pitfalls – BDAs (of CDI 1.0) - 2

• Exceptions
  – Interceptor class:
    SecurityInterceptor is already defined
• Solutions:
  – Ensure that jar files aren’t duplicated in the
    deployed archive (e.g. different versions,…)
  – Clear IDE and server caches
    (if it happens during the development process)
Common Pitfalls – Old Versions

• Try to use the newest version of the
  application-server of your choice from the
  very beginning
• It isn‘t just about small tweaks.
  Some old versions are utterly broken
• If an old version can’t be avoided,
  upgrade the CDI implementation (if possible)
Common Pitfalls – ContextNotActive

• Top 3 reasons
  1. Invalid usage
     (e.g. JSF specific context used in a
      Servlet-Filter, Batch-Job,…)
  2. Configuration issue
  3. Implementation issue (of the context)
… closes the gaps!

APACHE DELTASPIKE
History of DeltaSpike

• 12-2011
  accepted to join the Apache Incubator
• 2-2012
  first release (0.1-incubating)
ASF Mentors

•   David Blevins
•   Gerhard Petracek
•   Jim Jagielski
•   Mark Struberg
•   Matt Benson
•   Matthias Wessendorf
Initial Committers - 1

•   Andy Gibson
•   Antoine Sabot-Durand
•   Arne Limburg
•   Brian Leathem
•   Cody Lerum
•   David Blevins
•   George Gastaldi
•   Gerhard Petracek
Initial Committers - 2

•   Jakob Korherr
•   Jason Porter
•   John Ament
•   Jozef Hartinger
•   Ken Finnigan
•   Marius Bogoevici
•   Mark Struberg
•   Matthias Wessendorf
Initial Committers - 3

•   Pete Muir
•   Pete Royle
•   Rick Hightower
•   Shane Bryzak
•   Stuart Douglas
•   //some joined short afterwards
DeltaSpike Modules

• 0.1-incubating
  – Core (new)
• 0.2-incubating
  – Core (improved)
  – Security (new)
DeltaSpike closes the gaps between …

• … Java-EE and the needs of real-world
  applications
• … different CDI communities
History of Apache DeltaSpike

                                               Java-EE
                                               with CDI



  Java-EE                                                                  Other
                                     Seam2                Seam3
without CDI                                                              Extensions



                             Spring                                 DeltaSpike
                          Framework

                                       MyFaces
                                                          MyFaces CODI
                                       Orchestra

              + CDI implementation
MyFaces CODI to DeltaSpike Migration

• Discussions are started with the original
  feature/concept
• Everybody is welcome to provide a
  refinement or counter-proposal
• If there is no better solution and there are
  no major objections, a feature will be added
• The community tries to merge everything
  which is completely portable
Apache DeltaSpike.Next

• Simple answer:
  There is no fixed master plan! The future
  depends on the community -> get involved!
DELTASPIKE - A QUICK TOUR
FINAL Q & A
Links

• http://myfaces.apache.org/extensions/cdi/
• https://cwiki.apache.org/confluence/display/EXTCDI/Index
• https://svn.apache.org/repos/asf/myfaces/extensions/cdi/
• http://twitter.com/MyFacesTeam
• http://myfaces.apache.org/extensions/cdi/mail-lists.html

• https://cwiki.apache.org/confluence/display/DeltaSpike
• http://s.apache.org/ds_git
• https://builds.apache.org/view/A-F/view/DeltaSpike/
• http://twitter.com/DeltaSpikeTeam

Contenu connexe

Tendances

MyFaces Extensions Validator r3 News
MyFaces Extensions Validator r3 NewsMyFaces Extensions Validator r3 News
MyFaces Extensions Validator r3 Newsos890
 
Spring 4 on Java 8 by Juergen Hoeller
Spring 4 on Java 8 by Juergen HoellerSpring 4 on Java 8 by Juergen Hoeller
Spring 4 on Java 8 by Juergen HoellerZeroTurnaround
 
Security Architecture of the Java platform
Security Architecture of the Java platformSecurity Architecture of the Java platform
Security Architecture of the Java platformMartin Toshev
 
Polygot Java EE on the GraalVM
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVMRyan Cuprak
 
Going Native With The OSGi Service Layer - Sascha Zelzer
Going Native With The OSGi Service Layer - Sascha ZelzerGoing Native With The OSGi Service Layer - Sascha Zelzer
Going Native With The OSGi Service Layer - Sascha Zelzermfrancis
 
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application DevelopmentOSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application DevelopmentSanjeeb Sahoo
 
Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7Azilen Technologies Pvt. Ltd.
 
Java 9 Module System Introduction
Java 9 Module System IntroductionJava 9 Module System Introduction
Java 9 Module System IntroductionDan Stine
 
OSGi in 5 minutes
OSGi in 5 minutesOSGi in 5 minutes
OSGi in 5 minutesSerge Huber
 
Introduction tomaven
Introduction tomavenIntroduction tomaven
Introduction tomavenManav Prasad
 
Getting Started with Java EE 7
Getting Started with Java EE 7Getting Started with Java EE 7
Getting Started with Java EE 7Arun Gupta
 
Java build tool_comparison
Java build tool_comparisonJava build tool_comparison
Java build tool_comparisonManav Prasad
 
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)Robert Scholte
 
MyFaces Extensions Validator 1.x.2 News
MyFaces Extensions Validator 1.x.2 NewsMyFaces Extensions Validator 1.x.2 News
MyFaces Extensions Validator 1.x.2 Newsos890
 
MyFaces Extensions Validator Part 1 of 3
MyFaces Extensions Validator Part 1 of 3MyFaces Extensions Validator Part 1 of 3
MyFaces Extensions Validator Part 1 of 3os890
 
Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011
Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011
Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011Arun Gupta
 

Tendances (20)

MyFaces Extensions Validator r3 News
MyFaces Extensions Validator r3 NewsMyFaces Extensions Validator r3 News
MyFaces Extensions Validator r3 News
 
Spring 4 on Java 8 by Juergen Hoeller
Spring 4 on Java 8 by Juergen HoellerSpring 4 on Java 8 by Juergen Hoeller
Spring 4 on Java 8 by Juergen Hoeller
 
Security Architecture of the Java platform
Security Architecture of the Java platformSecurity Architecture of the Java platform
Security Architecture of the Java platform
 
Polygot Java EE on the GraalVM
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVM
 
Going Native With The OSGi Service Layer - Sascha Zelzer
Going Native With The OSGi Service Layer - Sascha ZelzerGoing Native With The OSGi Service Layer - Sascha Zelzer
Going Native With The OSGi Service Layer - Sascha Zelzer
 
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application DevelopmentOSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
 
Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7
 
Java 9 Module System Introduction
Java 9 Module System IntroductionJava 9 Module System Introduction
Java 9 Module System Introduction
 
OSGi in 5 minutes
OSGi in 5 minutesOSGi in 5 minutes
OSGi in 5 minutes
 
Liferay maven sdk
Liferay maven sdkLiferay maven sdk
Liferay maven sdk
 
Introduction tomaven
Introduction tomavenIntroduction tomaven
Introduction tomaven
 
OSGi Presentation
OSGi PresentationOSGi Presentation
OSGi Presentation
 
Getting Started with Java EE 7
Getting Started with Java EE 7Getting Started with Java EE 7
Getting Started with Java EE 7
 
Java build tool_comparison
Java build tool_comparisonJava build tool_comparison
Java build tool_comparison
 
Java 9 preview
Java 9 previewJava 9 preview
Java 9 preview
 
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
 
MyFaces Extensions Validator 1.x.2 News
MyFaces Extensions Validator 1.x.2 NewsMyFaces Extensions Validator 1.x.2 News
MyFaces Extensions Validator 1.x.2 News
 
MyFaces Extensions Validator Part 1 of 3
MyFaces Extensions Validator Part 1 of 3MyFaces Extensions Validator Part 1 of 3
MyFaces Extensions Validator Part 1 of 3
 
Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011
Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011
Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011
 
Intro To OSGi
Intro To OSGiIntro To OSGi
Intro To OSGi
 

Similaire à MyFaces CODI and JBoss Seam3 become Apache DeltaSpike

UKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUlrich Krause
 
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)Chris O'Brien
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulMert Çalışkan
 
SOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesSOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesVagif Abilov
 
Juggling Java EE with Enterprise Apache Maven
Juggling Java EE with Enterprise Apache MavenJuggling Java EE with Enterprise Apache Maven
Juggling Java EE with Enterprise Apache Mavenelliando dias
 
Maven introduction in Mule
Maven introduction in MuleMaven introduction in Mule
Maven introduction in MuleShahid Shaik
 
SCaLE 15x - How Container Schedulers and Software-Defined Storage will Change...
SCaLE 15x - How Container Schedulers and Software-Defined Storage will Change...SCaLE 15x - How Container Schedulers and Software-Defined Storage will Change...
SCaLE 15x - How Container Schedulers and Software-Defined Storage will Change...David vonThenen
 
XPages -Beyond the Basics
XPages -Beyond the BasicsXPages -Beyond the Basics
XPages -Beyond the BasicsUlrich Krause
 
Monoliths are so 2001 – What you need is Modularity
Monoliths are so 2001 – What you need is ModularityMonoliths are so 2001 – What you need is Modularity
Monoliths are so 2001 – What you need is ModularityGraham Charters
 
Community day 2013 applied architectures
Community day 2013   applied architecturesCommunity day 2013   applied architectures
Community day 2013 applied architecturesPanagiotis Kefalidis
 
CFWheels - Pragmatic, Beautiful Code
CFWheels - Pragmatic, Beautiful CodeCFWheels - Pragmatic, Beautiful Code
CFWheels - Pragmatic, Beautiful Codeindiver
 
[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the BasicsUlrich Krause
 
How Container Schedulers and Software-based Storage will Change the Cloud
How Container Schedulers and Software-based Storage will Change the CloudHow Container Schedulers and Software-based Storage will Change the Cloud
How Container Schedulers and Software-based Storage will Change the CloudDavid vonThenen
 
An introduction to maven gradle and sbt
An introduction to maven gradle and sbtAn introduction to maven gradle and sbt
An introduction to maven gradle and sbtFabio Fumarola
 
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdfITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdfOrtus Solutions, Corp
 

Similaire à MyFaces CODI and JBoss Seam3 become Apache DeltaSpike (20)

UKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basics
 
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
SOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesSOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class Libraries
 
Juggling Java EE with Enterprise Apache Maven
Juggling Java EE with Enterprise Apache MavenJuggling Java EE with Enterprise Apache Maven
Juggling Java EE with Enterprise Apache Maven
 
Maven introduction in Mule
Maven introduction in MuleMaven introduction in Mule
Maven introduction in Mule
 
Apache DeltaSpike: The CDI Toolbox
Apache DeltaSpike: The CDI ToolboxApache DeltaSpike: The CDI Toolbox
Apache DeltaSpike: The CDI Toolbox
 
Apache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolboxApache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolbox
 
SCaLE 15x - How Container Schedulers and Software-Defined Storage will Change...
SCaLE 15x - How Container Schedulers and Software-Defined Storage will Change...SCaLE 15x - How Container Schedulers and Software-Defined Storage will Change...
SCaLE 15x - How Container Schedulers and Software-Defined Storage will Change...
 
XPages -Beyond the Basics
XPages -Beyond the BasicsXPages -Beyond the Basics
XPages -Beyond the Basics
 
Monoliths are so 2001 – What you need is Modularity
Monoliths are so 2001 – What you need is ModularityMonoliths are so 2001 – What you need is Modularity
Monoliths are so 2001 – What you need is Modularity
 
Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
Community day 2013 applied architectures
Community day 2013   applied architecturesCommunity day 2013   applied architectures
Community day 2013 applied architectures
 
Require js training
Require js trainingRequire js training
Require js training
 
CFWheels - Pragmatic, Beautiful Code
CFWheels - Pragmatic, Beautiful CodeCFWheels - Pragmatic, Beautiful Code
CFWheels - Pragmatic, Beautiful Code
 
[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics
 
How Container Schedulers and Software-based Storage will Change the Cloud
How Container Schedulers and Software-based Storage will Change the CloudHow Container Schedulers and Software-based Storage will Change the Cloud
How Container Schedulers and Software-based Storage will Change the Cloud
 
An introduction to maven gradle and sbt
An introduction to maven gradle and sbtAn introduction to maven gradle and sbt
An introduction to maven gradle and sbt
 
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdfITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
 

Dernier

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dashnarutouzumaki53779
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 

Dernier (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dash
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 

MyFaces CODI and JBoss Seam3 become Apache DeltaSpike

  • 1. MYFACES CODI AND JBOSS SEAM3 BECOME APACHE DELTASPIKE
  • 2. Apache MyFaces CODI is … • … a portable CDI extension (no CDI implementation) • … compatible with Java-EE5+ • … tested on most major servers • … easy to use and extensible • … very fast and stable • … one "part" of Apache DeltaSpike • … one of few popular CDI extensions • … optimized for large applications • … developed by an open community
  • 3. History of MyFaces CODI • Apache MyFaces Orchestra introduced interesting concepts in combination with Spring • 12-2009 CDI 1.0 • 2-2010 MyFaces ExtCDI (aka CODI) started • 11-2010 first stable release (6 modules) • 7-2011 release of v1.0.0 (formal step - CODI was very stable already)
  • 4. Setup MyFaces CODI for Servlet Containers • Add the CDI implementation of your choice • Add MyFaces CODI to the project – With Maven • Add the modules (or the all-in-one bundle) to the POM – Without Maven • Download the current version of CODI • Add the modules (or the all-in-one bundle) to the Classpath of the project • Start using it!
  • 5. Webapp Setup by Example with Maven - 1 • The easy way: Add the all-in-one bundle for the version of JSF you are using (1.2.x or 2.x) Example for JSF 2.x <dependency> <groupId>org.apache.myfaces.extensions.cdi.bundles</groupId> <artifactId>myfaces-extcdi-bundle-jsf20</artifactId> <version>1.0.5</version> <scope>compile</scope> </dependency>
  • 6. Webapp Setup by Example with Maven - 2 • An alternative: Generate a template project mvn archetype:generate -DarchetypeCatalog= http://myfaces.apache.org Example for JSF 2.x
  • 7. Webapp Setup by Example without Maven • Download the binary distribution which contains all modules: http://s.apache.org/myfaces_binaries/ -> e.g.: myfaces-extcdi-assembly-jsf20-1.0.5-bin.zip or the all-in-one bundle: http://s.apache.org/codi_mvn_bundles -> e.g.: myfaces-extcdi-bundle-jsf20/1.0.5/ myfaces-extcdi-bundle-jsf20-1.0.5.jar • Add the JAR(s) of your choice to /WEB-INF/lib
  • 8. MyFaces CODI Modules - Overview - 1 • Core • JSF Module (for 1.2 and 2.x) • JPA Module • BV Module • I18N-Message Module • Scripting Module
  • 9. MyFaces CODI Modules - Overview - 2 • Trinidad Support Module (for 1.x and 2.x) • Java-EE5 Support Module • Bundles (+ OSGi Bundles) • Test Modules • Alternative Config and Impl Modules
  • 10. MyFaces CODI – TOP 10 (unordered) • Type-safe and extensible Project-Stages • Conditional bean activation • Scopes • Type-safe View-Config and Navigation Workshop • Type-safe CODI-Config examples • View-Controller • Extensibility (Security, Interceptors, Factories, …) • Advanced I18n • Transactional beans without EJBs • Configurable JPA DataSource
  • 11. Symbols DS … Same concept used for DeltaSpike DS … Similar concept used for DeltaSpike DS … Concept planned for DeltaSpike
  • 12. Type-safe and extensible Project-Stages DS • … with Java-EE6 – Only available in JSF – Not type-safe – Not extensible • … with MyFaces CODI – Available for all CDI based applications – Type-safe – Extensible
  • 13. Project-Stages Configuration by Example • Configuration – Not in the deployable archive (e.g. web.xml) – Via build- or container-configuration – Useful e.g. in combination with maven profiles • Example with Jetty (+ Maven3) <configuration> <systemProperties> <systemProperty> <name>faces.PROJECT_STAGE</name> <value>Development</value> </systemProperty> </systemProperties> </configuration>
  • 14. Conditional Bean Activation DS • … with Java-EE6 – Not out-of-the-box (Manually via a CDI-Extension and ProcessAnnotatedType#veto) • … with MyFaces CODI – @ProjectStageActivated (supports also custom project-stages) – @ExpressionActivated (+ customizable expression syntax)
  • 15. @ProjectStageActivated by Example @Alternative //+ config in beans.xml @ProjectStageActivated(ProjectStage.Production.class) public class ProductionCodiCoreConfig extends CodiCoreConfig { @Override public boolean isConfigurationLoggingEnabled() { return false; } }
  • 16. Scopes • … with std. CDI and JSF (JSF Scopes not integrated ) – Request-, Session-, Application-Scope – View-, Flash-, Custom-, None-Scope (JSF) – Conversation-, Dependent, Singleton-Scope (CDI) • … with MyFaces CODI – Autom. converts JSF beans to CDI beans DS – Window-, (Grouped-)Conversation-, ViewAccess-, Rest-Scope (for CDI + JSF) – Transaction-Scope (for CDI) Different types of conversations
  • 17. CODI Scopes by Example - Window-Scope • Without MyFaces CODI – e.g.: @SessionScoped public class MyBean implements Serializable { //… } -> multiple Browser-Tabs use the same instances • With MyFaces CODI – e.g.: @WindowScoped public class MyBean implements Serializable { //… }
  • 18. Destroy MyFaces CODI Conversations • Close a conversation @Inject private Conversation conversation; this.conversation.close(); • Use the Window-Context @Inject private WindowContext windowContext; this.windowContext.close(); //and #close*
  • 19. Type-safe View-Config • … with std. JSF – Not available • … with MyFaces CODI DS – Type-safe navigation – View-Controller, Security,… – Meta-data inheritance – Custom meta-data – Checked target regions
  • 20. Type-safe View-Config by Example – 1 • Allow to – host meta-data for pages – structure pages – navigate in a type-safe way – inherit meta-data • Inline usage at page-beans is possible • Example for index.xhtml @Page public class Index implements ViewConfig {}
  • 21. Type-safe View-Config by Example – 2 • POST-Requests <h:commandButton … action="#{myPageController.next}"/> public Class<? extends ViewConfig> next() { //Pages extends ViewConfig, Index implements Pages return Pages.Index.class; } • GET-Requests <h:link ... outcome="#{myPageController.nextPage}"/> public Class<? extends Pages> getNextPage() { //Pages extends ViewConfig, Index implements Pages return Pages.Index.class; }
  • 22. Type-safe View-Config - Advanced • http://s.apache.org/make-jsf-more-typesafe – View-Controller Annotations – Integration with @Secured – Default Error-View – Easy manual navigation via ViewNavigationHandler – Observe a pre-navigation event (navigation target can be changed) – Custom Meta-data –…
  • 23. MYFACES CODI - A QUICK TOUR
  • 24. Migrating the example FROM SERVLET CONTAINER TO APPLICATION SERVER
  • 25. Migration to Java-EE6+ Application Server • General steps for all servers: – Java-EE dependencies are provided by the server (-> don’t deploy them) – Remove the CDI listener (web.xml)
  • 26. Migration to Oracle GlassFish 3.1.x • Java-EE6 reference implementation • CDI Implementation: JBoss Weld • Use version 3.1.2+ if possible (at least v3.1.1) • Needed changes: – Std. changes for Java-EE6+ – See BDA hints esp. for GlassFish < v3.1.2
  • 27. Migration to IBM WebSphere 8 • First WAS version which implements Java-EE6 • CDI Implementation: OpenWebBeans (with BDA) • Use version 8.0.0.1+ • Needed changes: – Std. changes for Java-EE6+ – See BDA hints (OpenWebBeans is used in BDA mode)
  • 28. Migration to JBoss-AS7 • JBoss Application Server (implemented from scratch) • Since 7.1 Java-EE6 full profile • CDI Implementation: JBoss Weld • Needed changes: – Std. changes for Java-EE6+ – See BDA hints
  • 29. Migration to Oracle Weblogic 12c (R1) • First WLS version which implements Java-EE6 • CDI Implementation: JBoss Weld 1.1.3_SP1 • Needed changes: – Std. changes for Java-EE6+ – See BDA hints – Use the all-in-one bundle of MyFaces CODI 1.0.5+
  • 30. Migration to Apache TomEE v1 • TomEE is based on a std. Tomcat – Java-EE6 Web-Profile CDI, EJB, JPA, JSF, JSP, JSTL, JTA, Servlet, JavaMail, Bean Validation – TomEE+ adds JAX-RS, JAX-WS, JMS, Connectors • CDI Implementation: Apache OpenWebBeans • Needed changes: – Std. changes for Java-EE6+ -> That’s it
  • 31. Using MyFaces CODI with … • A list of tested servers and frameworks: http://s.apache.org/CODI_Compatibility
  • 32. Common Pitfalls – Bootstrapping order • Java-EE6 servers usually start CDI before JSF • Not all servers have a deterministic order • Sometimes it depends on the version – e.g.: Jetty6 vs Jetty7 (vs Jetty8) • Exception: IllegalStateException: no […]BeanManagerProvider in place! Please ensure that you configured the CDI implementation of your choice properly. If your setup is correct, please clear all caches and compiled artifacts. If there is still a problem, try one of the controlled bootstrapping add-ons for the CDI implementation you are using. • Solutions: – The exception provides the details already – Another exception occurred before -> fix it
  • 33. Common Pitfalls – Cross-BDAs issues • Bean deployment archives The implementation depends on the interpretation of the specification • Spec. issues: CDI-18, CDI-112 – A strict implementation restricts various artifacts to the same bean archive – A misinterpretation or bug can break applications easily E.g.: @Alternative annotated beans are only valid for the same archive -> breaks a lot of use-cases -> OWB (standalone) ignores this rule by default • Implementation issues: – Several versions of Weld < v1.1.4 are broken e.g. regarding @Specialize WELD-912, WELD-974,…
  • 34. Common Pitfalls – BDAs (of CDI 1.0) - 1 • Exceptions – Enabled interceptor class SecurityInterceptor is neither annotated @Interceptor nor registered through a portable extension – No bean found for type: [CODI class] – Unsatisfied dependencies for type [CODI class] • Solutions (steps): step until it works 1. Use the all-in-one package of MyFaces CODI Follow it step by 2. Copy the content of beans.xml to the beans.xml of the application 3. The version of the CDI implementation is utterly broken -> upgrade it
  • 35. Common Pitfalls – BDAs (of CDI 1.0) - 2 • Exceptions – Interceptor class: SecurityInterceptor is already defined • Solutions: – Ensure that jar files aren’t duplicated in the deployed archive (e.g. different versions,…) – Clear IDE and server caches (if it happens during the development process)
  • 36. Common Pitfalls – Old Versions • Try to use the newest version of the application-server of your choice from the very beginning • It isn‘t just about small tweaks. Some old versions are utterly broken • If an old version can’t be avoided, upgrade the CDI implementation (if possible)
  • 37. Common Pitfalls – ContextNotActive • Top 3 reasons 1. Invalid usage (e.g. JSF specific context used in a Servlet-Filter, Batch-Job,…) 2. Configuration issue 3. Implementation issue (of the context)
  • 38. … closes the gaps! APACHE DELTASPIKE
  • 39. History of DeltaSpike • 12-2011 accepted to join the Apache Incubator • 2-2012 first release (0.1-incubating)
  • 40. ASF Mentors • David Blevins • Gerhard Petracek • Jim Jagielski • Mark Struberg • Matt Benson • Matthias Wessendorf
  • 41. Initial Committers - 1 • Andy Gibson • Antoine Sabot-Durand • Arne Limburg • Brian Leathem • Cody Lerum • David Blevins • George Gastaldi • Gerhard Petracek
  • 42. Initial Committers - 2 • Jakob Korherr • Jason Porter • John Ament • Jozef Hartinger • Ken Finnigan • Marius Bogoevici • Mark Struberg • Matthias Wessendorf
  • 43. Initial Committers - 3 • Pete Muir • Pete Royle • Rick Hightower • Shane Bryzak • Stuart Douglas • //some joined short afterwards
  • 44. DeltaSpike Modules • 0.1-incubating – Core (new) • 0.2-incubating – Core (improved) – Security (new)
  • 45. DeltaSpike closes the gaps between … • … Java-EE and the needs of real-world applications • … different CDI communities
  • 46. History of Apache DeltaSpike Java-EE with CDI Java-EE Other Seam2 Seam3 without CDI Extensions Spring DeltaSpike Framework MyFaces MyFaces CODI Orchestra + CDI implementation
  • 47. MyFaces CODI to DeltaSpike Migration • Discussions are started with the original feature/concept • Everybody is welcome to provide a refinement or counter-proposal • If there is no better solution and there are no major objections, a feature will be added • The community tries to merge everything which is completely portable
  • 48. Apache DeltaSpike.Next • Simple answer: There is no fixed master plan! The future depends on the community -> get involved!
  • 49. DELTASPIKE - A QUICK TOUR
  • 51. Links • http://myfaces.apache.org/extensions/cdi/ • https://cwiki.apache.org/confluence/display/EXTCDI/Index • https://svn.apache.org/repos/asf/myfaces/extensions/cdi/ • http://twitter.com/MyFacesTeam • http://myfaces.apache.org/extensions/cdi/mail-lists.html • https://cwiki.apache.org/confluence/display/DeltaSpike • http://s.apache.org/ds_git • https://builds.apache.org/view/A-F/view/DeltaSpike/ • http://twitter.com/DeltaSpikeTeam